📄 xec_accessories.h
字号:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
*/
#include "ictk.h"
#include "xbn_z.h"
#include "surrender.h"
#ifndef XEC_ACCESSORIES_H
#define XEC_ACCESSORIES_H
#ifdef __cplusplus
extern "C" {
#endif
/* Construct an array of Solinas primes of a given bit size (size given
* by the bits arg).
* Build either all primes of the given size or if there are more
* primes than arraySize, build only arraySize primes.
* Set numberOfPrimes to the number of primes found.
* This function expects qa and qb to be arrays of ints of length
* arraySize. It expects qc and qs to be arrays of sign_ts of length
* arraySize. It expects qz to be an array of z_t pointers of length
* arraySize. If any elements in the array is not NULL, this function
* expects that those elements are valid z_t pointers. In other words,
* it is the responsibility of the caller to allocate the array and
* initiaize each element to NULL before calling this function the
* first time. It is also the responsibility of the caller to call zDel
* on any element that contains a valid z_t pointer.
*/
int zSolinasMakeAll (
int *numberOfPrimes,
int *qa,
int *qb,
sign_t *qc,
sign_t *qs,
z_t **qz,
unsigned int arraySize,
int bits,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber,
VtRandomObject random,
bf_context_t *bf
);
/* generate qbits-bit Solinas prime q = 2^a +- 2^b +- 1 such that
* p = r*q - 1 is prime too, where r is a rbits-bit randomly generated
* multiple of a
* set result to true_n if parameters are found, false_n if not.
* The return value is 0 for no error or a non-zero error code. It is
* possible to return 0 and set result to false_n. The function
* completed successfully, it just did not find params.
*/
int ec1ParamGenRandomized (
bool_t *result,
z_t *p_out,
z_t *q_out,
z_t *r_out,
z_t *a,
int qbits,
int rbits,
int attempts,
VoltSurrenderCtx *surrCtx,
unsigned int surrFlag,
unsigned int *callNumber,
VtRandomObject random,
bf_context_t *bf
);
#ifdef __cplusplus
}
#endif
#endif /* XEC_ACCESSORIES_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -