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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? prime.h

?? IBE是一種非對(duì)稱密碼技術(shù)
?? H
?? 第 1 頁 / 共 2 頁
字號(hào):
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

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

#ifndef _PRIME_H
#define _PRIME_H

#ifdef __cplusplus
extern "C" {
#endif

/* Generate a prime of bit size primeSizeBits using the sieve and
 * Rabin-Miller tests. The random object will be the source of random
 * bytes and the result will be placed into the prime.
 * <p>The primeSizeBits must be greater than 32. This is almost an
 * arbitrary limit. The code is written so that the length must be
 * greater than or equal to 9, but it is also safer to make sure the
 * length is long enough so that a prime of the exact specified length
 * is found.
 * <p>This function will run the Rabin-Miller test, which is iterative.
 * Some standards call for an iteration count of 8 or 27 or 50. So
 * whoever is calling must indicate the iteration count. It must be at
 * least 8.
 * <p>The leadingBits arg indicates how many of the most significant
 * bits must be set. If the arg is 1, the function will make sure the
 * most significant bit is set, but cannot guarantee any following bits
 * are set (of course, the least significant bit will be set, after
 * all, the prime number will be an odd number). It is possible that
 * the random object happens to generate a value for which the second
 * most significant bit is also set, it's just that the function cannot
 * guarantee any bit other than the most significant. If the arg is 2,
 * the function will make sure the two most significant bits are set.
 * If the leadingBits arg is anything other than 1 or 2, the function
 * will consider it to be 2.
 * <p>The reason for the leadingBits arg is for RSA key pair
 * generation. For example, if the requested RSA modulus size is 1024
 * bits, the key pair generator will generate two 512-bit primes.
 * However, when mulitplying two 512-bit numbers, the result can be
 * 1023 or 1024 bits. If the two most significant bits of each prime
 * are set, then the product will definitely be 1024 bits.
 * <p>The relativePrime arg can be NULL. If so, the function finds a
 * prime. If not, the function will find a prime such that
 * <pre>
 * <code>
 *    prime - 1  is relatively prime with  relativePrime
 * </code>
 * </pre>
 * <p>This is for RSA key pair generation, where the public exponent
 * must be relatively prime with p - 1 and q - 1.
 * <p>The oneRandom flag is there to pass FIPS certification. A FIPS
 * test requires finding the next prime after a random starting point.
 * The code can also try to find a prime close to a random starting
 * point, but if not, just throw away that point and get a new random
 * value.
 * <p>If this function cannot generate a prime, it will return
 * VT_ERROR_NO_PRIME_FOUND.
 * <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_DSA_PARAM_GEN) indicating who wants the PQG.
 *
 * @param primeSizeBits The size, in bits, of the prime to generate.
 * @param leadingBits Either 1 or 2, indicates how many of the most
 * significant bits of the prime should be guaranteed to be set.
 * @param oneRandom This flag says to find the next prime after the
 * first random value, or to throw away values and generate new
 * random starting points. If 0 (false/no), use more than one random
 * starting point if necessary. If 1 (true/yes), use only one random
 * starting point.
 * @param random A random object, the source of any random bytes needed.
 * @param surrCtx
 * @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 relativePrime If NULL, ignored, if not NULL, the function
 * will find a prime such that prime - 1 is relatively prime with this
 * value.
 * @param prime Where the resulting prime will be deposited.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV VoltGeneratePrimeRabinMiller VOLT_PROTO_LIST ((
   unsigned int primeSizeBits,
   unsigned int leadingBits,
   unsigned int iterationCount,
   unsigned int oneRandom,
   VtRandomObject random,
   VoltSurrenderCtx *surrCtx,
   unsigned int surrFlag,
   unsigned int *callNumber,
   VoltMpInt *relativePrime,
   VoltMpInt *prime
));

/* Generate a prime of bit size primeSizeBits using the sieve,
 * Rabin-Miller, and Lucas tests. This will follow the technique
 * outlined in section 4.1.2.1 of X9.31.
 * <p>The random object will be the source of random bytes and the
 * result will be placed into the prime.
 * <p>The primeSizeBits must be greater than or equal to 512 and a
 * multiple of 128. This is a requirement of X9.31.
 * <p>The relativePrime arg can be NULL. If so, the function finds a
 * prime. If not, the function will find a prime such that
 * <pre>
 * <code>
 *    prime - 1  is relatively prime with  relativePrime
 * </code>
 * </pre>
 * <p>This is for RSA key pair generation, where the public exponent
 * must be relatively prime with p - 1 and q - 1.
 * <p>If this function cannot generate a prime, it will return
 * VT_ERROR_NO_PRIME_FOUND.
 * <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_DSA_PARAM_GEN) indicating who wants the PQG.
 *
 * @param primeSizeBits The size, in bits, of the prime to generate.
 * @param random A random object, the source of any random bytes needed.
 * @param surrCtx
 * @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 relativePrime If NULL, ignored, if not NULL, the function
 * will find a prime such that prime - 1 is relatively prime with this
 * value.
 * @param prime Where the resulting prime will be deposited.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV VoltGeneratePrimeX931 VOLT_PROTO_LIST ((
   unsigned int primeSizeBits,
   VtRandomObject random,
   VoltSurrenderCtx *surrCtx,
   unsigned int surrFlag,
   unsigned int *callNumber,
   VoltMpInt *relativePrime,
   VoltMpInt *prime
));

/* Generate a prime of bit size primeSizeBits using the technique
 * outlined in FIPS 186-2, appendix 2. This will perform steps 1 - 5 of
 * section 2.1 in appendix 2.
 * <p>This function currently operates only when primeSizeBits is 160.
 * <p>The routine will use the Rabin-Miller test to determine if a
 * number is prime.
 * <p>The caller must pass in a SEED buffer large enough to hold
 * primeSizeBits. For example, if primeSizeBits is 160, the SEED buffer
 * must be at least 20 bytes. This function will not check the validity
 * of the SEED argument, it is the responsibility of the caller to make
 * sure SEED is a valid buffer (not NULL) and big enough. Upon return,
 * the SEED buffer will contain the original SEED used to generate the
 * prime. The function will set the unsigned int at seedLen to be the
 * number of bytes placed into the SEED buffer. Once again, this
 * function will not check the validity of the seedLen input argument,
 * it is the responsibility of the caller to pass in a valid pointer.
 * <p>If this function cannot generate a prime, it will return
 * VT_ERROR_NO_PRIME_FOUND.
 *
 * @param primeSizeBits The size, in bits, of the prime to generate.
 * @param random A random object, the source of any random bytes needed.
 * @param SEED The buffer into which the function will place the FIPS
 * SEED value.
 * @param seedLen The address where the function will deposit the
 * length, in bytes, of SEED. That is, it will be the number of bytes
 * placed into the SEED buffer.
 * @param prime Where the resulting prime will be deposited.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV VoltGeneratePrimeFips VOLT_PROTO_LIST ((
   unsigned int primeSizeBits,
   VtRandomObject random,
   unsigned char *SEED,
   unsigned int *seedLen,
   VoltMpInt *prime
));

/* Generate a prime of bit size primeSizeBits using the technique
 * outlined in X9.42, annex B (section B.1.2). This will perform steps
 * 1 - 8.
 * <p>This function currently operates only when primeSizeBits is 160.
 * <p>The routine will use the Rabin-Miller test to determine if a
 * number is prime.
 * <p>The caller must pass in a SEED buffer large enough to hold
 * primeSizeBits. For example, if primeSizeBits is 160, the SEED buffer
 * must be at least 20 bytes. This function will not check the validity
 * of the SEED argument, it is the responsibility of the caller to make
 * sure SEED is a valid buffer (not NULL) and big enough. Upon return,
 * the SEED buffer will contain the original SEED used to generate the
 * prime. The function will set the unsigned int at seedLen to be the
 * number of bytes placed into the SEED buffer. Once again, this
 * function will not check the validity of the seedLen input argument,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日精品一区视频| 国产精品每日更新在线播放网址| 一区二区三区在线影院| 色系网站成人免费| 亚洲超碰97人人做人人爱| 欧美日韩在线直播| 免费成人小视频| 26uuu国产在线精品一区二区| 国产精品一二一区| 自拍偷拍亚洲欧美日韩| 欧美图区在线视频| 久久精品国产**网站演员| 国产午夜精品美女毛片视频| 亚洲四区在线观看| 欧美久久婷婷综合色| 国精品**一区二区三区在线蜜桃| 国产精品色哟哟| 色综合 综合色| www.在线欧美| 色哦色哦哦色天天综合| 日韩国产一二三区| 国产精品私人影院| 欧美日韩国产高清一区二区三区| 精品在线视频一区| 亚洲欧美日韩国产综合| 中文字幕亚洲一区二区va在线| 日本不卡123| 国产精品福利在线播放| 欧美日韩成人综合在线一区二区 | 91精品国模一区二区三区| 久久精品久久99精品久久| 国产精品国产三级国产aⅴ原创| 欧美熟乱第一页| 国产成人精品在线看| 亚洲午夜免费视频| 中文字幕免费不卡| 欧美精品vⅰdeose4hd| 成人国产精品视频| 日本不卡高清视频| 亚洲一区二区精品3399| 国产欧美精品在线观看| 91精品国产91久久综合桃花| 亚洲欧美在线aaa| 精品欧美乱码久久久久久| 91免费观看国产| 国产成人啪免费观看软件 | 日本不卡一区二区三区| 欧美国产综合一区二区| 日韩欧美亚洲国产精品字幕久久久| 成人精品视频一区二区三区| 日本一道高清亚洲日美韩| 亚洲日本欧美天堂| 欧美国产亚洲另类动漫| 精品欧美乱码久久久久久| 精品国产免费人成电影在线观看四季 | 免费美女久久99| 一区二区三区不卡视频| 国产午夜精品一区二区三区嫩草 | 国内精品第一页| 午夜精品久久久久久久蜜桃app| 国产精品美女久久久久久2018| 欧美电影免费观看高清完整版在线观看| 色婷婷av一区二区三区之一色屋| 国产成人午夜视频| 国产一区二区在线影院| 久久国产精品99久久久久久老狼| 天天综合色天天综合色h| 亚洲男人天堂一区| 亚洲另类春色国产| 91成人在线精品| 91丨porny丨在线| 99国产精品99久久久久久| 高清日韩电视剧大全免费| 国产一区二区视频在线播放| 激情图区综合网| 久久成人18免费观看| 美女一区二区视频| 免费成人在线网站| 精品一区二区免费看| 精品一区二区免费| 国产精品77777| 成人午夜免费电影| 成人av在线播放网站| 欧美日韩专区在线| 91丨九色丨蝌蚪丨老版| 91精品1区2区| 在线影视一区二区三区| 欧美伊人久久久久久久久影院 | 美女视频网站久久| 日韩精品一区二区三区四区| 日韩欧美国产一二三区| 精品对白一区国产伦| 久久综合中文字幕| 国产精品伦一区| 亚洲精品乱码久久久久久| 午夜精品久久久久久久久久| 六月丁香婷婷久久| 国产精品香蕉一区二区三区| 成人开心网精品视频| 一本到不卡免费一区二区| 欧美日韩夫妻久久| 国产精品 日产精品 欧美精品| 丁香婷婷综合网| 在线亚洲一区二区| 91精品婷婷国产综合久久性色 | 欧美怡红院视频| 日韩欧美国产精品| 国产精品欧美一区喷水| 亚洲乱码精品一二三四区日韩在线| 亚洲小少妇裸体bbw| 久久99最新地址| 成人app下载| 日韩一级欧美一级| 国产精品福利一区二区三区| 性做久久久久久| www.欧美色图| 色综合中文字幕国产 | 欧美高清www午色夜在线视频| 日韩三级精品电影久久久| 国产女主播在线一区二区| 亚洲精品美国一| 韩国一区二区三区| 欧美日韩一区二区不卡| 国产三区在线成人av| 亚洲成在线观看| 大美女一区二区三区| 欧美高清视频一二三区 | 美女脱光内衣内裤视频久久影院| 国产精品白丝在线| 裸体在线国模精品偷拍| 色欧美片视频在线观看在线视频| 欧美zozo另类异族| 日韩一区二区中文字幕| 亚洲人xxxx| 国产中文字幕一区| 欧美精品一二三区| 亚洲欧美aⅴ...| 岛国精品一区二区| 久久综合色天天久久综合图片| 亚洲综合一区二区精品导航| 国产一区二区美女| 一本一道综合狠狠老| 国产午夜精品一区二区| 精品夜夜嗨av一区二区三区| 欧美视频一区二区| 日韩伦理免费电影| 成人黄色777网| 久久噜噜亚洲综合| 91在线视频免费观看| 欧美日韩一区二区欧美激情| 亚洲美女视频在线观看| 成人黄色小视频| 久久久精品tv| 国产精品资源网站| 精品福利一区二区三区| 免费精品视频最新在线| 欧美日韩国产高清一区二区三区| 亚洲一区二区三区四区五区黄| 粉嫩久久99精品久久久久久夜| 久久午夜老司机| 国产精品影音先锋| 久久日韩精品一区二区五区| 蜜臀久久久久久久| 欧美一区二区日韩| 蜜臀av一区二区在线观看| 91.com视频| 蜜臀99久久精品久久久久久软件| 欧美日本国产视频| 日韩国产成人精品| 日韩一级片在线观看| 久久99久久久久| aaa国产一区| 亚洲欧美色综合| 欧美影片第一页| 99re这里只有精品视频首页| 91在线观看地址| 最好看的中文字幕久久| 色噜噜久久综合| 亚洲一区视频在线观看视频| 欧美手机在线视频| 婷婷综合另类小说色区| 91精品国产aⅴ一区二区| 国内一区二区视频| 中文字幕精品一区| 91精品办公室少妇高潮对白| 亚洲va欧美va国产va天堂影院| 欧美日韩国产精选| 国产在线一区观看| 亚洲一区二区三区四区不卡| 色av成人天堂桃色av| 日本中文字幕一区二区有限公司| 日韩精品在线一区| 成人性生交大片免费看在线播放| 亚洲丝袜精品丝袜在线| 欧美日韩夫妻久久| 国产乱子伦视频一区二区三区 | 高清beeg欧美| 亚洲综合久久久| 欧美一级理论片| 成人app在线|