BN_asc2bn

Parse an ASCII decimal or hexadecimal integer into a BIGNUM.

Synopsis

Declared in <openssl/bn.h>

int
BN_asc2bn(
    BIGNUM** a,
    char const* str);

Description

A leading '-' sets the negative flag. Trailing non-digit characters are ignored after a successful parse of a number prefix.

Return Value

1 on success, or 0 on parse error.

Parameters

NameDescription
aLocation of the BIGNUM pointer; allocated if *a is NULL.
strDecimal digits, or a hex string with a leading "0x" / "0X".