TBPValue
Data types, cryptography
Description
TBPValue is the fixed-size working value of the pure-Pascal Brainpool ECDSA suite. It is an array of 33 Int64 cells: the low 32 cells carry one radix-2^16 limb each and the final cell holds the overflow carry, which gives the arithmetic a 528-bit working width. Index 0 is the least significant limb.
Curve parameters, private scalars, public key coordinates and signature parts are all represented this way. Values normally stay below the curve prime or order. Use BPFromHex, BPFromBytes and their counterparts to load and store values, or BPLoadCurve to obtain the RFC 5639 parameters without touching the limbs.
Syntax
Delphi
TBPValue = Array [0..32] Of Int64;Remarks
BPFromHex accepts 1 to 128 hexadecimal digits and clears the array before parsing; BPFromBytes accepts 1 to 64 bytes. Both place the low limb at index 0.
BPToHex emits lower-case digits without a leading zero run and returns 0 for a zero value; BPToBytes emits exactly the requested byte length, from 1 to 64.
The type has no managed fields, so a variable can be copied and zeroed with FillChar; the arithmetic routines expect canonical 16-bit limbs rather than full 64-bit cell contents.
The top cell is a carry slot: the 16-bit limb arithmetic keeps cells 0 through 31 masked and leaves the final cell free for an overflow carry.
See also
BPFromHex, BPToHex, BPFromBytes, BPToBytes, BPLoadCurve, BPKeyGen