⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bn_num_bytes.pod

📁 Openssl 0.9.8e 最新版OpenSSL
💻 POD
字号:
=pod=head1 NAMEBN_num_bits, BN_num_bytes, BN_num_bits_word - get BIGNUM size=head1 SYNOPSIS #include <openssl/bn.h> int BN_num_bytes(const BIGNUM *a); int BN_num_bits(const BIGNUM *a); int BN_num_bits_word(BN_ULONG w);=head1 DESCRIPTIONBN_num_bytes() returns the size of a B<BIGNUM> in bytes.BN_num_bits_word() returns the number of significant bits in a word.If we take 0x00000432 as an example, it returns 11, not 16, not 32.Basically, except for a zero, it returns I<floor(log2(w))+1>.BN_num_bits() returns the number of significant bits in a B<BIGNUM>,following the same principle as BN_num_bits_word().BN_num_bytes() is a macro.=head1 RETURN VALUESThe size.=head1 NOTESSome have tried using BN_num_bits() on individual numbers in RSA keys,DH keys and DSA keys, and found that they don't always come up withthe number of bits they expected (something like 512, 1024, 2048,...).  This is because generating a number with some specific numberof bits doesn't always set the highest bits, thereby making the numberof I<significant> bits a little lower.  If you want to know the "keysize" of such a key, either use functions like RSA_size(), DH_size()and DSA_size(), or use BN_num_bytes() and multiply with 8 (althoughthere's no real guarantee that will match the "key size", just a lotmore probability).=head1 SEE ALSOL<bn(3)|bn(3)>, L<DH_size(3)|DH_size(3)>, L<DSA_size(3)|DSA_size(3)>,L<RSA_size(3)|RSA_size(3)>=head1 HISTORYBN_num_bytes(), BN_num_bits() and BN_num_bits_word() are available inall versions of SSLeay and OpenSSL.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -