亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dh.h

?? IBE是一種非對稱密碼技術
?? H
字號:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

#include "vibecrypto.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "paramobj.h"
#include "algobj.h"
#include "keyobj.h"
#include "mpint.h"
#include "surrender.h"

#ifndef _DH_H
#define _DH_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
  unsigned int primeSizeBits;
  unsigned int subprimeSizeBits;
} VoltDHParamGenCtx;

/* Implements VGenerateParameters
 */
int VOLT_CALLING_CONV DHGenerateParameters VOLT_PROTO_LIST ((
   VtParameterObject paramObj,
   VtRandomObject random
));

/* This function generates prime P, subprime Q, and base G following
 * the instructions in the X9.42 document. The primes will be chosen
 * such that subprimeQ is a divisor of (primeP - 1).
 * <p>The SEED, and counter values are returned because the caller may
 * be doing some FIPS work and will need them. The caller must pass a
 * SEED buffer and it must be big enough to hold subprimeSizeBits. This
 * function will not check the arguments, it is the responsibility of
 * the caller to pass a valid SEED buffer (not NULL) that is big
 * enough, along with valid pointers seedLen and counter.
 * <p>The length of the subprime must be less than the length of the
 * prime. The base will be the same size as the prime.
 * <p>The caller can pass a surrender context if one is available (NULL
 * is allowed). The surrFlag is a VT_SURRENDER_FNCT_ flag (such as
 * VT_SURRENDER_FNCT_DH_PARAM_GEN) indicating who wants the PQG.
 *
 * @param mpCtx The mpCtx to use for multi-precision operations.
 * @param surrCtx This can be NULL, but if not, the surrender ctx to
 * call at various intervals.
 * @param surrFlag A VT_SURRENDER_FNCT_ flag indicating what operation
 * is running, to tell the surrender function who is calling it.
 * @param callNumber The current callNumber of the surrender ctx. The
 * caller should pass the current value at the address given, the
 * function will return the number it eventually reaches at that
 * address.
 * @param primeSizeBits The size, in bits, of the prime to generate.
 * @param subprimeSizeBits The size, in bits, of the subprime to generate.
 * @param random A random object, the source of any random bytes needed.
 * @param primeP Where the resulting prime will be deposited.
 * @param subprimeQ Where the resulting subprime will be deposited.
 * @param baseG Where the resulting base will be deposited.
 * @param SEED The buffer into which the FIPS SEED value will be placed.
 * @param seedLen The address where the function will deposit the
 * length, in bytes, of the value deposited into the SEED buffer.
 * @param counter The address where the function will deposit the FIPS
 * counter value.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV VoltGeneratePQGX942 VOLT_PROTO_LIST ((
   VoltMpIntCtx *mpCtx,
   VoltSurrenderCtx *surrCtx,
   unsigned int surrFlag,
   unsigned int *callNumber,
   unsigned int primeSizeBits,
   unsigned int subprimeSizeBits,
   VtRandomObject random,
   VoltMpInt *primeP,
   VoltMpInt *subprimeQ,
   VoltMpInt *baseG,
   unsigned char *SEED,
   unsigned int *seedLen,
   unsigned int *counter
));

typedef struct
{
  VtMpIntCtx     mpCtx;
  unsigned int   primeSizeBits;
  VtItem         primeP;
  VtItem         subprimeQ;
  VtItem         baseG;
} VoltDHKeyGenCtx;

/* Implements VGenerateKey
 */
int VOLT_CALLING_CONV DHGenerateKeyPair VOLT_PROTO_LIST ((
   VtKeyObject priKey,
   VtKeyObject pubKey,
   VtRandomObject random
));

#define VOLT_DH_PRI_VAL_LEN  20

/* This is part of FIPS random x and k generation.
 */
#define VOLT_DH_XKEY_LEN     32
#define VOLT_DH_XSEED_LEN    32

/* This is how params are stored internally.
 */
typedef struct
{
  VoltMpInt          *primeP;
  VoltMpInt          *subprimeQ;
  VoltMpInt          *baseG;
  VtDHParamInfo       paramInfo;
  VtDHParamFipsInfo   fipsInfo;
} VoltDHParams;

/* If the DH param info is given by MpInt's, call this routine to store
 * the info in the object.
 * <p>If the FIPS info (SEED, counter) is available, pass it in. If
 * not, don't.
 * <p>This function does not check the args, it is the responsibility
 * of the caller to pass in a valid parameter object with an mpCtx
 * inside, valid MpInts (the subprimeQ can be NULL), a valid SEED (or
 * NULL with length 0), and the correct counter (or 0).
 * <p>In fact, it is the responsibility of the caller to make sure the
 * args match. That is, if the SEED is NULL, then the seedLen MUST be
 * 0 and the counter MUST be 0. If the counter is 0, then there can be
 * no SEED.
 * <p>If there is a SEED and counter, there MUST be a subprime.
 */
int VOLT_CALLING_CONV VoltAddDHParametersMpInt VOLT_PROTO_LIST ((
   VoltParameterObject *obj,
   VoltMpInt *primeP,
   VoltMpInt *subprimeQ,
   VoltMpInt *baseG,
   unsigned char *SEED,
   unsigned int seedLen,
   unsigned int counter
));

/* This is how DH key data is stored internally.
 * If you build a key and store the key data, it must be this format.
 * That is, if the VOLT_KEY_TYPE_DATA bit in the keyObject->keyType
 * field is set, the keyData must point to this struct.
 * Each of the types, public, private and key pair, must begin with the
 * keyType field, a flag so we can know what the struct is. It will be
 * set to one of the following values.
 *
 *    VOLT_KEY_TYPE_PUBLIC
 *    VOLT_KEY_TYPE_PRIVATE
 *    VOLT_KEY_TYPE_PAIR
 *
 * The public and private key types must look alike from top to bottom,
 * except for the priValX at the bottom. They can both be dereferenced
 * as a public key and the keyItems and params will be in the same
 * place.
 */
typedef struct
{
  unsigned int type;
  VtDHPriKeyInfo *keyItems;
  VoltMpInt *primeP;
  VoltMpInt *subprimeQ;
  VoltMpInt *baseG;
  VoltMpInt *pubValY;
  VoltMpInt *priValX;
} VoltDHPrivateKey;

typedef struct
{
  unsigned int type;
  VtDHPubKeyInfo *keyItems;
  VoltMpInt *primeP;
  VoltMpInt *subprimeQ;
  VoltMpInt *baseG;
  VoltMpInt *pubValY;
} VoltDHPublicKey;

typedef struct
{
  unsigned int type;
  VtKeyObject pubKey;
  VtKeyObject priKey;
} VoltDHKeyPair;

/* Implements VGenerateKey
 */
int VOLT_CALLING_CONV DHGenerateKeyPair VOLT_PROTO_LIST ((
   VtKeyObject priKey,
   VtKeyObject pubKey,
   VtRandomObject random
));

/* Implements VGenerateSharedSecret
 */
int VOLT_CALLING_CONV VoltDHGenerateSharedSecret VOLT_PROTO_LIST ((
   VoltAlgorithmObject *obj,
   VtKeyObject otherPartyPubKey,
   VtKeyObject myPriKey,
   VtKeyObject sharedSecret,
   VtRandomObject random
));
/* Perform Diffie-Hellman. This determines if a pub and pri key are
 * indeed DH partners.
 * <p>If the two are partners, this function will return 0. If the keys
 * are not, the function will return an error code.
 * <p>This routine assumes that the random object is valid.
 *
 * @param libCtx The libCtx to use.
 * @param surrCtx If not NULL, pass it on to any function that takes a
 * surrender ctx.
 * @param pubKey The alleged public key.
 * @param priKey The alleged private key.
 * @param random A random object to use as a source of any random bytes
 * if needed.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV VoltTestDHKeyPair VOLT_PROTO_LIST ((
   VoltLibCtx *libCtx,
   VoltSurrenderCtx *surrCtx,
   VtKeyObject pubKey,
   VtKeyObject priKey,
   VtRandomObject random
));

/* Implements VCtxDestroy.
 */
void VOLT_CALLING_CONV DHParameterDataDestroy VOLT_PROTO_LIST ((
   Pointer obj,
   Pointer ctx
));

/* Implements VCopyParams.
 */
int VOLT_CALLING_CONV DHCopyParams VOLT_PROTO_LIST ((
   Pointer sourceParamObj,
   Pointer destParamObj
));

/* Implements VCtxDestroy.
 */
void VOLT_CALLING_CONV DHKeyDataDestroy VOLT_PROTO_LIST ((
   Pointer obj,
   Pointer ctx
));

/* Implements VCloneObject.
 */
int VOLT_CALLING_CONV VoltCloneDHPubKey VOLT_PROTO_LIST ((
   Pointer sourceObject,
   Pointer *destObject
));

/* Implements VCloneObject.
 */
int VOLT_CALLING_CONV VoltCloneDHPriKey VOLT_PROTO_LIST ((
   Pointer sourceObject,
   Pointer *destObject
));

/* Implements VCloneObject.
 */
int VOLT_CALLING_CONV VoltCloneDHSharedSecret VOLT_PROTO_LIST ((
   Pointer sourceObject,
   Pointer *destObject
));

#ifdef __cplusplus
}
#endif

#endif /* _DH_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线精品不卡| 国产高清亚洲一区| 国产成+人+日韩+欧美+亚洲| 色94色欧美sute亚洲13| 久久久久国产精品厨房| 日韩精品国产精品| 91麻豆国产在线观看| 欧美经典一区二区三区| 日本美女一区二区三区| 精品视频1区2区| 亚洲欧洲精品一区二区精品久久久| 免费av成人在线| 欧美色综合久久| 亚洲日本在线看| 北岛玲一区二区三区四区| 欧美va亚洲va香蕉在线| 日本不卡123| 欧美一级高清片| 亚洲国产成人va在线观看天堂| 成人sese在线| 日本一区二区三区久久久久久久久不 | 久久久久久久久久久黄色| 免播放器亚洲一区| 7777精品伊人久久久大香线蕉经典版下载 | 国产女主播在线一区二区| 久久97超碰国产精品超碰| 欧美精品久久99| 亚洲影视在线播放| 欧美日韩国产精品成人| 偷拍一区二区三区| 在线不卡一区二区| 人禽交欧美网站| 91精品国产综合久久婷婷香蕉| 亚洲高清免费观看高清完整版在线观看| 北条麻妃国产九九精品视频| 国产精品美女久久久久久2018| 国产精品乡下勾搭老头1| 国产午夜三级一区二区三| 国产91清纯白嫩初高中在线观看| 久久亚洲综合色一区二区三区| 国产在线不卡一卡二卡三卡四卡| 精品国产一区a| 国产精品一区二区黑丝| 国产精品色哟哟| 97se亚洲国产综合自在线观| 亚洲国产日产av| 91精品婷婷国产综合久久性色 | heyzo一本久久综合| 亚洲人成伊人成综合网小说| 欧美羞羞免费网站| 欧美bbbbb| 国产欧美日韩三级| 9l国产精品久久久久麻豆| 亚洲三级电影网站| 欧美一区二区三区在线视频 | 手机精品视频在线观看| 精品免费日韩av| www.久久精品| 日韩成人一级大片| 欧美激情在线观看视频免费| 色综合久久久久综合| 午夜亚洲国产au精品一区二区| 欧美成人bangbros| 91亚洲精华国产精华精华液| 视频在线观看一区| 中文av一区二区| 欧美高清激情brazzers| 国产高清亚洲一区| 日韩精品一二三| 1024精品合集| 亚洲精品一区二区三区影院| 91麻豆精品在线观看| 韩国精品主播一区二区在线观看| 亚洲乱码中文字幕综合| 欧美不卡激情三级在线观看| 91影视在线播放| 精品一区二区三区在线播放视频 | 在线观看视频一区二区欧美日韩| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲激情男女视频| 久久久国产精华| 欧美日韩国产一区| 97久久超碰国产精品| 国产原创一区二区三区| 亚洲bt欧美bt精品| 国产精品久久国产精麻豆99网站| 日韩欧美国产成人一区二区| 色婷婷综合五月| 国产美女在线观看一区| 日韩电影一二三区| 亚洲电影中文字幕在线观看| 中文字幕中文字幕一区二区| 精品久久久网站| 91精品国产一区二区人妖| 91香蕉国产在线观看软件| 国产美女精品在线| 久久黄色级2电影| 香蕉乱码成人久久天堂爱免费| 亚洲欧洲国产日韩| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 狠狠色狠狠色综合系列| 日韩国产欧美三级| 三级精品在线观看| 天堂午夜影视日韩欧美一区二区| 亚洲女同女同女同女同女同69| 亚洲国产精品av| 国产亚洲成年网址在线观看| 久久久影视传媒| 久久综合资源网| 精品99一区二区三区| 精品久久久网站| 欧美精品一区二区不卡| 亚洲精品在线观| 国产午夜精品一区二区三区嫩草| 精品国产91洋老外米糕| 26uuu另类欧美| 国产亚洲视频系列| 国产性天天综合网| 自拍偷拍亚洲欧美日韩| 亚洲男人的天堂av| 一区二区欧美国产| 丝袜亚洲另类欧美| 六月丁香婷婷久久| 成人小视频在线观看| 91免费看片在线观看| 欧美性极品少妇| 日韩一区二区视频| 久久精子c满五个校花| 亚洲欧洲精品一区二区精品久久久| 亚洲欧美日韩电影| 亚洲第一成年网| 精品一区二区三区不卡| 国产不卡一区视频| 日本韩国欧美三级| 欧美一区日韩一区| 26uuu久久综合| 亚洲美女屁股眼交| 日韩电影一二三区| 高清日韩电视剧大全免费| 色狠狠综合天天综合综合| 91精品国模一区二区三区| 26uuu另类欧美亚洲曰本| 日韩理论片在线| 日韩电影在线免费观看| 成人免费视频一区二区| 色88888久久久久久影院按摩 | 91在线云播放| 欧美一二三四在线| 日本一区二区三区视频视频| 亚洲成人久久影院| 国产乱人伦偷精品视频不卡| 一本大道综合伊人精品热热| 91精品国产综合久久婷婷香蕉 | 国产人伦精品一区二区| 一区二区三区在线视频观看 | 在线观看日韩av先锋影音电影院| 欧美一区二区三区视频| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲v精品v日韩v欧美v专区| 国产裸体歌舞团一区二区| 在线观看视频一区二区| 国产无人区一区二区三区| 亚洲国产视频网站| 成人黄色在线网站| 精品少妇一区二区三区在线播放| 一区二区三区在线观看视频| 国产夫妻精品视频| 91精品午夜视频| 亚洲一区精品在线| www.日本不卡| 久久看人人爽人人| 水蜜桃久久夜色精品一区的特点| 9l国产精品久久久久麻豆| 久久一区二区三区四区| 日本强好片久久久久久aaa| 一本一本大道香蕉久在线精品| 精品国产免费人成电影在线观看四季| 亚洲丝袜自拍清纯另类| 国产91综合一区在线观看| 日韩你懂的在线播放| 婷婷国产在线综合| 欧美日韩精品电影| 一区二区三区在线观看国产| 岛国av在线一区| 国产亚洲制服色| 国产一区二区调教| 亚洲精品一区二区三区精华液| 日韩精品国产精品| 4438亚洲最大| 日韩在线一二三区| 7777精品伊人久久久大香线蕉的 | 国产精品电影院| 丁香婷婷综合色啪| 国产亚洲精品7777| 成人一级片在线观看| 国产日韩欧美综合在线| 国产成人亚洲综合a∨婷婷图片 | 8x8x8国产精品| 三级亚洲高清视频| 欧美一级欧美三级在线观看|