diff options
author | huangqinjin <huangqinjin@gmail.com> | 2016-05-18 18:07:10 +0800 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-27 10:05:44 +0100 |
commit | 5e0dc5c9992ad53d12b07eb5d12a0e23dd5be670 (patch) | |
tree | 4d289e327e35541b99477cefdc12e820d08daf2f | |
parent | 58c03e3b9225fe1a8e3f6b8c23c45b33e26fedb5 (diff) |
Update the documentation of BN_hex2bn()
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
-rw-r--r-- | doc/crypto/BN_bn2bin.pod | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/doc/crypto/BN_bn2bin.pod b/doc/crypto/BN_bn2bin.pod index b229da7b70..8098fd9df5 100644 --- a/doc/crypto/BN_bn2bin.pod +++ b/doc/crypto/BN_bn2bin.pod @@ -51,11 +51,12 @@ hexadecimal and decimal encoding of B<a> respectively. For negative numbers, the string is prefaced with a leading '-'. The string must be freed later using OPENSSL_free(). -BN_hex2bn() converts the string B<str> containing a hexadecimal number -to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new -B<BIGNUM> is created. If B<bn> is NULL, it only computes the number's -length in hexadecimal digits. If the string starts with '-', the -number is negative. BN_dec2bn() is the same using the decimal system. +BN_hex2bn()takes as many characters as possible from the string B<str>, +including the leading character '-' which means negative, to form a valid +hexadecimal number representation and converts them to a B<BIGNUM> and +stores it in **B<bn>. If *B<bn> is NULL, a new B<BIGNUM> is created. If +B<bn> is NULL, it only computes the length of valid representation. +BN_dec2bn() is the same using the decimal system. BN_print() and BN_print_fp() write the hexadecimal encoding of B<a>, with a leading '-' for negative numbers, to the B<BIO> or B<FILE> @@ -84,8 +85,9 @@ BN_bn2binpad() returns the number of bytes written or -1 if the supplied buffer is too small. BN_bn2hex() and BN_bn2dec() return a null-terminated string, or NULL -on error. BN_hex2bn() and BN_dec2bn() return the number's length in -hexadecimal or decimal digits, and 0 on error. +on error. BN_hex2bn() and BN_dec2bn() return the the length of valid +representation in hexadecimal or decimal digits, and 0 on error, in which +case no new B<BIGNUM> will be created. BN_print_fp() and BN_print() return 1 on success, 0 on write errors. |