TPLSHA384Digest

Cryptography, digital signatures

Description

TPLSHA384Digest is a fixed array[0..47] of Byte that carries a 48-byte digest by value. SHA384ByteArray and SHA3_384ByteArray return it, and the 48 bytes match the certificate-hash width that signing-certificate V2 attributes use for SHA-384.

Element 0 is the first and most significant byte as the hash emits it, matching the byte order used by CMS and certificate structures. The fixed width lets the type live inline in a record or be passed by value, so a 48-byte hash never needs a separate heap allocation. It carries no algorithm identifier, so a consumer that must know which hash produced it has to take that from the surrounding structure.

Syntax

Delphi

TPLSHA384Digest = Array [0.. 47] Of Byte;

Remarks

The SHA-3 selector reuses this type, so the same 48 bytes can come from SHA-384 or SHA3-384 and the caller must remember which algorithm produced them.

The stream-range form SHA384StreamRange hashes the two signed ranges of a revision and returns the result as an AnsiString, which is how the signing path computes the digest it embeds.

The *Raw helpers return the same bytes as an AnsiString; the fixed array is the form to use in records and method parameters.

Render a fingerprint byte by byte, for example LowerCase(IntToHex(Digest[I], 2)); the type has no ToString-style helper.

Assignment copies the whole array, and comparison needs CompareMem or a loop because array equality is not defined.

SizeOf is 48, so the value can be written to a file or a hash field as one block; no length prefix travels with it.

See also

SHA384ByteArray, SHA3_384ByteArray, SHA384StreamRange