
B_RandomInit
B_RandomInit
int B_RandomInit ( |
|
|
|
|
B_ALGORITHM_OBJ | randomAlgorithm, | /* random algorithm object */ | ||
B_ALGORITHM_CHOOSER algorithmChooser, | * | algorithm | chooser */ | |
A_SURRENDER_CTX | *surrenderContext | /* | surrender | context */ |
); |
|
|
|
|
|
|
|
|
|
Description
B_RandomInit initializes randomAlgorithm for generating random bytes using the algorithm specified by a previous call to B_SetAlgorithmInfo. randomAlgorithm is ready to generate bytes after the call to B_RandomInit. However, it is necessary to mix in random seed values with B_RandomUpdate. Otherwise, without seed values, the bytes generated by the algorithm follow a default unseeded byte sequence. The chooser for selecting the algorithm method is algorithmChooser. The surrender context for processing and canceling during lengthy operations is surrenderContext; if its value is (A_SURRENDER_CTX *)NULL_PTR,
B_RandomInit is called once to create the generator, then B_RandomUpdate is called one or more times to add “seed” bytes (values that are hard for an attacker to predict) to the generator. After enough seed is added, for example, at least 128 bytes, then B_GenerateRandomBytes can be called one or more times to generate blocks of
again.
Return value
Value | Description |
0 | Operation was successful. |
see Appendix A, | |
|
|
3 2 8 | R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l |