struct bn_gencb_st

Defined at line 573 of file ../../third_party/boringssl/src/include/openssl/bn.h

bn_gencb_st, or |BN_GENCB|, holds a callback function that is used by

generation functions that can take a very long time to complete. Use

|BN_GENCB_set| to initialise a |BN_GENCB| structure.

The callback receives the address of that |BN_GENCB| structure as its last

argument and the user is free to put an arbitrary pointer in |arg|. The other

arguments are set as follows:

- event=BN_GENCB_GENERATED, n=i: after generating the i'th possible prime

number.

- event=BN_GENCB_PRIME_TEST, n=-1: when finished trial division primality

checks.

- event=BN_GENCB_PRIME_TEST, n=i: when the i'th primality test has finished.

The callback can return zero to abort the generation progress or one to

allow it to continue.

When other code needs to call a BN generation function it will often take a

BN_GENCB argument and may call the function with other argument values.

Public Members

void * arg
int (*)(int, int, struct bn_gencb_st *) callback