BPFromHex

Cryptography

Description

Converts a big-endian hexadecimal string into the 528-bit TBPValue working value used by the Brainpool ECDSA suite

The string may hold at most 128 hex digits and accepts upper or lower case; the value is zero-filled on output, so shorter strings load the low limbs of the 33-limb core

Syntax

Delphi

Function BPFromHex(Out V: TBPValue; Const Hex: AnsiString): Boolean;

Parameters

VReceives the parsed value; always zero-filled before parsing starts
HexBig-endian hexadecimal digits, 1 to 128 characters

Return values

FalseThe string is empty, longer than 128 digits, or contains a non-hex character; V is left zeroed
TrueV holds the parsed value

Remarks

Curve parameters and keys in RFC 5639 are published as hexadecimal, so this helper is the natural way to load them before BPLoadCurve-based arithmetic or BPKeyGen key material conversion

See also

BPToHex, BPLoadCurve, BPKeyGen, BPSignFixedK