⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lbn16.h

📁 包含哈希,对称以及非对称的经典算法 包含经典事例
💻 H
字号:
#ifndef LBN16_H#define LBN16_H#include "lbn.h"#ifndef BNWORD16#error 16-bit bignum library requires a 16-bit data type#endif#ifndef lbnCopy_16void lbnCopy_16(BNWORD16 *dest, BNWORD16 const *src, unsigned len);#endif#ifndef lbnZero_16void lbnZero_16(BNWORD16 *num, unsigned len);#endif#ifndef lbnNeg_16void lbnNeg_16(BNWORD16 *num, unsigned len);#endif#ifndef lbnAdd1_16BNWORD16 lbnAdd1_16(BNWORD16 *num, unsigned len, BNWORD16 carry);#endif#ifndef lbnSub1_16BNWORD16 lbnSub1_16(BNWORD16 *num, unsigned len, BNWORD16 borrow);#endif#ifndef lbnAddN_16BNWORD16 lbnAddN_16(BNWORD16 *num1, BNWORD16 const *num2, unsigned len);#endif#ifndef lbnSubN_16BNWORD16 lbnSubN_16(BNWORD16 *num1, BNWORD16 const *num2, unsigned len);#endif#ifndef lbnCmp_16int lbnCmp_16(BNWORD16 const *num1, BNWORD16 const *num2, unsigned len);#endif#ifndef lbnMulN1_16void lbnMulN1_16(BNWORD16 *out, BNWORD16 const *in, unsigned len, BNWORD16 k);#endif#ifndef lbnMulAdd1_16BNWORD16lbnMulAdd1_16(BNWORD16 *out, BNWORD16 const *in, unsigned len, BNWORD16 k);#endif#ifndef lbnMulSub1_16BNWORD16 lbnMulSub1_16(BNWORD16 *out, BNWORD16 const *in, unsigned len, BNWORD16 k);#endif#ifndef lbnLshift_16BNWORD16 lbnLshift_16(BNWORD16 *num, unsigned len, unsigned shift);#endif#ifndef lbnDouble_16BNWORD16 lbnDouble_16(BNWORD16 *num, unsigned len);#endif#ifndef lbnRshift_16BNWORD16 lbnRshift_16(BNWORD16 *num, unsigned len, unsigned shift);#endif#ifndef lbnMul_16void lbnMul_16(BNWORD16 *prod, BNWORD16 const *num1, unsigned len1,	BNWORD16 const *num2, unsigned len2);#endif#ifndef lbnSquare_16void lbnSquare_16(BNWORD16 *prod, BNWORD16 const *num, unsigned len);#endif#ifndef lbnNorm_16unsigned lbnNorm_16(BNWORD16 const *num, unsigned len);#endif#ifndef lbnBits_16unsigned lbnBits_16(BNWORD16 const *num, unsigned len);#endif#ifndef lbnExtractBigBytes_16void lbnExtractBigBytes_16(BNWORD16 const *bn, unsigned char *buf,	unsigned lsbyte, unsigned buflen);#endif#ifndef lbnInsertBigytes_16void lbnInsertBigBytes_16(BNWORD16 *n, unsigned char const *buf,	unsigned lsbyte,  unsigned buflen);#endif#ifndef lbnExtractLittleBytes_16void lbnExtractLittleBytes_16(BNWORD16 const *bn, unsigned char *buf,	unsigned lsbyte, unsigned buflen);#endif#ifndef lbnInsertLittleBytes_16void lbnInsertLittleBytes_16(BNWORD16 *n, unsigned char const *buf,	unsigned lsbyte,  unsigned buflen);#endif#ifndef lbnDiv21_16BNWORD16 lbnDiv21_16(BNWORD16 *q, BNWORD16 nh, BNWORD16 nl, BNWORD16 d);#endif#ifndef lbnDiv1_16BNWORD16 lbnDiv1_16(BNWORD16 *q, BNWORD16 *rem,	BNWORD16 const *n, unsigned len, BNWORD16 d);#endif#ifndef lbnModQ_16unsigned lbnModQ_16(BNWORD16 const *n, unsigned len, unsigned d);#endif#ifndef lbnDiv_16BNWORD16lbnDiv_16(BNWORD16 *q, BNWORD16 *n, unsigned nlen, BNWORD16 *d, unsigned dlen);#endif#ifndef lbnMontInv1_16BNWORD16 lbnMontInv1_16(BNWORD16 const x);#endif#ifndef lbnMontReduce_16void lbnMontReduce_16(BNWORD16 *n, BNWORD16 const *mod, unsigned const mlen,                BNWORD16 inv);#endif#ifndef lbnToMont_16void lbnToMont_16(BNWORD16 *n, unsigned nlen, BNWORD16 *mod, unsigned mlen);#endif#ifndef lbnFromMont_16void lbnFromMont_16(BNWORD16 *n, BNWORD16 *mod, unsigned len);#endif#ifndef lbnExpMod_16int lbnExpMod_16(BNWORD16 *result, BNWORD16 const *n, unsigned nlen,	BNWORD16 const *exp, unsigned elen, BNWORD16 *mod, unsigned mlen);#endif#ifndef lbnDoubleExpMod_16int lbnDoubleExpMod_16(BNWORD16 *result,	BNWORD16 const *n1, unsigned n1len, BNWORD16 const *e1, unsigned e1len,	BNWORD16 const *n2, unsigned n2len, BNWORD16 const *e2, unsigned e2len,	BNWORD16 *mod, unsigned mlen);#endif#ifndef lbnTwoExpMod_16int lbnTwoExpMod_16(BNWORD16 *n, BNWORD16 const *exp, unsigned elen,	BNWORD16 *mod, unsigned mlen);#endif#ifndef lbnGcd_16int lbnGcd_16(BNWORD16 *a, unsigned alen, BNWORD16 *b, unsigned blen);#endif#ifndef lbnInv_16int lbnInv_16(BNWORD16 *a, unsigned alen, BNWORD16 const *mod, unsigned mlen);#endif#endif /* LBN16_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -