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

📄 xid_bfcore.h

📁 IBE是一种非对称密码技术
💻 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 + -