?? xbn_fp2.h
字號:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
*/
#include "ictk.h"
#include "xbn_z.h"
#include "xbn_fp.h"
#ifndef XBN_FP2_H
#define XBN_FP2_H
#ifdef __cplusplus
extern "C" {
#endif
/* allocates and inits new fp2
*/
int fp2New (
bf_context_t *bf,
fp2_t **newFp2
);
/* clears and deallocates fp2
*/
void fp2Del (
fp2_t *x
);
/* Is a == 0
*/
bool_t fp2IsZero (
fp2_t *a
);
/* Does a == b
*/
bool_t fp2IsEqual (
fp2_t *a,
fp2_t *b
);
/* Set x = a
*/
int fp2Set (
fp2_t *x,
fp2_t *a
);
/* Set x = 0
*/
int fp2Set0 (
fp2_t *x
);
/* Set x = 1
*/
int fp2Set1 (
fp2_t *x
);
/* Set x = cube_root (1)
*/
int fp2SetCubeRootOne (
fp2_t *x,
z_t *p
);
/* Set x = -a
*/
int fp2Negate (
fp2_t *x,
fp2_t *a,
z_t *p
);
/* x = a + b
*/
int fp2Add (
fp2_t *x,
fp2_t *a,
fp2_t *b,
z_t *p
);
/* x = a - b
*/
int fp2Sub (
fp2_t *x,
fp2_t *a,
fp2_t *b,
z_t *p
);
/* x = a * b
*/
int fp2Mul (
fp2_t *x,
fp2_t *a,
fp2_t *b,
z_t *p
);
/* x = a * z
*/
int fp2MulZ (
fp2_t *x,
fp2_t *a,
z_t *z,
z_t *p
);
/* x = a ^ 2
*/
int fp2Sqr (
fp2_t *x,
fp2_t *a,
z_t *p
);
/* x = a ^ 2; uses scratch vars u and v
*/
int fp2SqrGivenScratch (
fp2_t *x,
fp2_t *a,
z_t *p,
z_t *u,
z_t *v
);
/* x = a / b
*/
int fp2Div (
fp2_t *x,
fp2_t *a,
fp2_t *b,
z_t *p
);
/* x = a ^ n
*/
int fp2Pow (
fp2_t *x,
fp2_t *a,
z_t *n,
z_t *p
);
/* Set r = random element of F_p^2
*/
int fp2Random (
fp2_t *r,
z_t *p,
VtRandomObject random
);
#ifdef __cplusplus
}
#endif
#endif // XBN_FP2_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -