BN_generate_prime_ex function
BN_generate_prime_ex sets |ret| to a prime number of |bits| length. If safe is non-zero then the prime will be such that (ret-1)/2 is also a prime. (This is needed for Diffie-Hellman groups to ensure that the only subgroups are of size 2 and (p-1)/2.).
If |add| is not NULL, the prime will fulfill the condition |ret| % |add| == |rem| in order to suit a given generator. (If |rem| is NULL then |ret| % |add| == 1.)
If |cb| is not NULL, it will be called during processing to give an indication of progress. See the comments for |BN_GENCB|. It returns one on success and zero otherwise.
Implementation
@meta.RecordUse()
@ffi.Native<
ffi.Int Function(
ffi.Pointer<BIGNUM>,
ffi.Int,
ffi.Int,
ffi.Pointer<BIGNUM>,
ffi.Pointer<BIGNUM>,
ffi.Pointer<BN_GENCB>,
)
>(symbol: 'bssl_dart_BN_generate_prime_ex')
external int BN_generate_prime_ex(
ffi.Pointer<BIGNUM> ret,
int bits,
int safe,
ffi.Pointer<BIGNUM> add,
ffi.Pointer<BIGNUM> rem,
ffi.Pointer<BN_GENCB> cb,
);