📄 bn_rand.pod
字号:
=pod=head1 NAMEBN_rand, BN_pseudo_rand - generate pseudo-random number=head1 SYNOPSIS #include <openssl/bn.h> int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);=head1 DESCRIPTIONBN_rand() generates a cryptographically strong pseudo-random number ofB<bits> bits in length and stores it in B<rnd>. If B<top> is true, thetwo most significant bits of the number will be set to 1, so that theproduct of two such random numbers will always have 2*B<bits> length.If B<bottom> is true, the number will be odd.BN_pseudo_rand() does the same, but pseudo-random numbers generated bythis function are not necessarily unpredictable. They can be used fornon-cryptographic purposes and for certain purposes in cryptographicprotocols, but usually not for key generation etc.The PRNG must be seeded prior to calling BN_rand().=head1 RETURN VALUESBN_rand() and BN_pseudo_rand() return 1 on success, 0 on error.The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.=head1 SEE ALSOL<bn(3)|bn(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>,L<RAND_add(3)|RAND_add(3)>, L<RAND_bytes(3)|RAND_bytes(3)>=head1 HISTORYBN_rand() is available in all versions of SSLeay and OpenSSL.BN_pseudo_rand() was added in OpenSSL 0.9.5.=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -