TSha512Digest = array[0..63] of Byte;
TSha384Digest = array[0..47] of Byte;
TSha512Context = record
State: array[0..7] of UInt64;
CountLo: UInt64;
CountHi: UInt64;
Buffer: array[0..127] of Byte;
BufLen: Integer;
Is384: Boolean;
end;
procedure Sha512Init(out Ctx: TSha512Context);
procedure Sha384Init(out Ctx: TSha512Context);
procedure Sha512Update(var Ctx: TSha512Context; const Buf; BufLen: Integer);
procedure Sha512Final(var Ctx: TSha512Context; out Digest: TSha512Digest);
procedure Sha384Final(var Ctx: TSha512Context; out Digest: TSha384Digest);
function Sha512Bytes(const B: TBytes): TSha512Digest;
function Sha384Bytes(const B: TBytes): TSha384Digest;
FPdfSha512 implementa le funzioni di hash SHA-512 e SHA-384 su un contesto condiviso a parole a 64 bit. Il flag Is384 nel contesto seleziona la variante troncata SHA-384 quando inizializzato tramite Sha384Init
L'API incrementale ricalca FPdfSha256: inizializzare un contesto, immettere buffer con Sha512Update e finalizzare verso un digest SHA-512 di 64 byte o un digest SHA-384 di 48 byte. Sha512Bytes e Sha384Bytes sono helper one-shot su un array di byte
| Funzione | Descrizione |
|---|---|
Sha512Init | Inizializza un contesto SHA-512 |
Sha384Init | Inizializza un contesto SHA-384 (imposta il flag interno Is384) |
Sha512Update | Immette un buffer non tipizzato in un contesto SHA-512 o SHA-384 aperto |
Sha512Final | Finalizza un contesto SHA-512 e restituisce il digest di 64 byte |
Sha384Final | Finalizza un contesto SHA-384 e restituisce il digest di 48 byte |
Sha512Bytes | Hash SHA-512 one-shot di un array di byte |
Sha384Bytes | Hash SHA-384 one-shot di un array di byte |
| Tipo | Descrizione |
|---|---|
TSha512Digest | Digest SHA-512 di 64 byte |
TSha384Digest | Digest SHA-384 di 48 byte |
TSha512Context | Contesto incrementale condiviso per SHA-512 e SHA-384 |
TSha512Context con il flag Is384 impostato da Sha384InitSha..., a differenza dei nomi in maiuscolo SHA256... di FPdfSha256