From 5e0dc5c9992ad53d12b07eb5d12a0e23dd5be670 Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Wed, 18 May 2016 18:07:10 +0800 Subject: [PATCH] Update the documentation of BN_hex2bn() Reviewed-by: Kurt Roeckx Reviewed-by: Matt Caswell --- doc/crypto/BN_bn2bin.pod | 16 +++++++++------- 1 file 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 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 containing a hexadecimal number -to a B and stores it in **B. If *B is NULL, a new -B is created. If B 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, +including the leading character '-' which means negative, to form a valid +hexadecimal number representation and converts them to a B and +stores it in **B. If *B is NULL, a new B is created. If +B 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, with a leading '-' for negative numbers, to the B or B @@ -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 will be created. BN_print_fp() and BN_print() return 1 on success, 0 on write errors. -- 2.25.1