?? xid_bfcore.h
字號:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
*/
#include "ictk.h"
#include "xec_accessories.h"
#include "surrender.h"
#ifndef XID_BFCORE_H
#define XID_BFCORE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
unsigned int sz;
char *buf;
bf_context_t *bf;
} ident_s;
typedef struct
{
pt1_t *pt;
bf_context_t *bf;
} publ_s;
typedef struct
{
pt1_t *pt;
bf_context_t *bf;
} priv_s;
typedef ident_s ident_t;
typedef publ_s publ_t;
typedef priv_s priv_t;
int commonNew (
common_t **newCommon,
bf_context_t *bf
);
void commonDel (
common_t *common
);
int secretNew (
secret_t **newSecret,
bf_context_t *bf
);
void secretDel (
secret_t *secret
);
int identNew (
ident_t **newIdent,
unsigned char *dat,
unsigned int sz,
bf_context_t *bf
);
void identDel (
ident_t *ident
);
int publNew (
publ_t **newPubl,
bf_context_t *bf
);
void publDel (
publ_t *publ
);
int privNew (
priv_t **newPriv,
bf_context_t *bf
);
void privDel (
priv_t *priv
);
/* sets up an elliptic curve given q and r, assumes q is Solinas
*/
int xidBFcoreLoadPlainEC (
common_t *common,
z_t *q,
z_t *r
);
/* loads up the common parameters ASSUMING common->curve is already
* present!
*/
int xidBFcoreLoadCommonParams (
common_t *common,
pt1_t *gener,
pt1_t *refer,
unsigned int accelCount,
unsigned char *accelTable,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber
);
/* loads up the master secret ASSUMING the curve and common parameters
* are already present!
*/
int xidBFcoreLoadMasterSecret (
secret_t *secret,
common_t *common,
z_t *master,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber
);
/* finds an elliptic curve of prescribed size
*/
int xidBFcorePickEC (
common_t *common,
int fld_bits,
int ord_bits,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber,
VtRandomObject random
);
/* picks the master secret and parameters ASSUMING common->curve is
* already present!
*/
int xidBFcorePickParams (
common_t *common,
secret_t *secret,
VtRandomObject random,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber
);
/* extracts a private key from given public key using the PKG
* master secret
*/
int xidBFcoreExtract (
priv_t *priv,
publ_t *publ,
secret_t *secret
);
/* derives a public key from given identity using the common parameters
*/
int xidBFcoreGetPubl (
publ_t *publ,
ident_t *id,
common_t *common
);
#ifdef __cplusplus
}
#endif
#endif // XID_BFCORE_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -