#include BIGNUM *BN_new(void); int BN_hex2bn(BIGNUM **a, const char *str); int BN_print_fp(FILE *fp, const BIGNUM *a); BN_new() allocates and initializes a BIGNUM structure. BN_hex2bn() takes as many characters as possible from the string str, including the leading character '-' which means negative, to form a valid hexadecimal number representation and converts them to a BIGNUM and stores it in **a. If *a is NULL, a new BIGNUM is created. If a is NULL, it only computes the length of valid representation. A "negative zero" is converted to zero. BN_dec2bn() is the same using the decimal system. BN_hex2bn() and BN_dec2bn() return the number of characters used in parsing, or 0 on error, in which case no new BIGNUM will be created. BN_print() and BN_print_fp() write the hexadecimal encoding of a, with a leading '-' for negative numbers, to the BIO or FILE fp. BN_print_fp() and BN_print() return 1 on success, 0 on write errors. --- BN_CTX *BN_CTX_new(void); int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); BN_CTX_new() allocates and initializes a BN_CTX structure. BN_add() adds a and b and places the result in r ("r=a+b"). r may be the same BIGNUM as a or b. BN_mul() multiplies a and b and places the result in r ("r=a*b"). r may be the same BIGNUM as a or b. For multiplication by powers of 2, use BN_lshift(3). BN_mod_exp() computes a to the p-th power modulo m ("r=a^p % m"). This function uses less time and space than BN_exp(). For all functions, ctx is a previously allocated BN_CTX used for temporary variables; see BN_CTX_new(3). Unless noted otherwise, the result BIGNUM must be different from the arguments. For all functions, 1 is returned for success, 0 on error. --- int BN_cmp(BIGNUM *a, BIGNUM *b); BN_cmp() compares the numbers a and b. BN_cmp() returns -1 if a < b, 0 if a == b and 1 if a > b.