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

📄 xbn_z.h

📁 IBE是一种非对称密码技术
💻 H
字号:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

#include "ictk.h"
#include "xbn_vsmath.h"

#ifndef XBN_Z_H
#define XBN_Z_H

#ifdef __cplusplus
extern "C" {
#endif

/* Set to 1 if no native modular arithmetic
 */
#define  ICTK_DELAY_MODULO  1

#define  zNew         vsm_zNew
#define  zDel         vsm_zDel
#define  zIsZero      vsm_zIsZero
#define  zIsEqual     vsm_zIsEqual
#define  zSet         vsm_zSet
#define  zSetUI       vsm_zSetUI
#define  zSetBit      vsm_zSetBit
#define  zSgn         vsm_zSgn
#define  zCmp         vsm_zCmp
#define  zCmpUI       vsm_zCmpUI
#define  zAdd         vsm_zAdd
#define  zAddUI       vsm_zAddUI
#define  zSub         vsm_zSub
#define  zSubUI       vsm_zSubUI
#define  zMul         vsm_zMul
#define  zMulUI       vsm_zMulUI
#define  zDivUI       vsm_zDivUI
#define  zMod         vsm_zMod
#define  zModUI       vsm_zModUI
#define  zPowM        vsm_zPowM
#define  zMul2exp     vsm_zMul2exp
#define  zInvert      vsm_zInvert
#define  zSqr         vsm_zSqr
#define  zTestBit     vsm_zTestBit
#define  zScan1       vsm_zScan1
#define  zSizeInBase  vsm_zSizeInBase
#define  zIsOdd       vsm_zIsOdd
#define  zIsEven      vsm_zIsEven
#define  zFDiv2exp    vsm_zFDiv2exp
#define  zFDiv        vsm_zFDiv
#define  zRawEncode   vsm_zRawEncode
#define  zRawDecode   vsm_zRawDecode

/* x <- random in { 0, ..., m - 1}
 */
int zRandomRange (
   z_t *x,
   z_t *m,
   VtRandomObject random
   );

/* x <- b-bit random number
 * if msb < 0, let the msBit be random (0 or 1, whatever the RNG
 * produces).
 * if msb == 0, make sure the msBit is 0.
 * if msb == 1, make sure the msBit is set to 1.
 * if msb == 2, make sure the two msBits are set to 1.
 * if lsb < 0, let the lsBit be random (0 or 1, whatever the RNG
 * produces).
 * if lsb == 0, make sure the lsBit is 0.
 * if lsb > 0, make sure the lsBit is set to 1.
 */
int zRandomBits (
   z_t *x,
   int b,
   int msb,
   int lsb,
   VtRandomObject random,
   bf_context_t *bf
   );

/* probable primality test
 */
int zProbabPrime (
   bool_t *result,
   z_t *a,
   VtRandomObject random,
   bf_context_t *bf
   );

#ifdef __cplusplus
}
#endif

#endif // XBN_Z_H

⌨️ 快捷键说明

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