PDFSM4EncryptedLength

Cryptography

Description

Computes the exact output length of PDFSM4EncryptString for a plaintext of the given size

Syntax

Delphi

Function PDFSM4EncryptedLength(PlaintextLength: Int64): Int64;

Parameters

PlaintextLengthPlaintext size in bytes

Return values

length16 bytes of IV plus the PKCS#7-padded body: 16 + ((Length div 16) + 1) * 16
-1PlaintextLength is negative

Remarks

Use this to size buffers before calling PDFSM4EncryptString or PDFSM4EncryptToStream

See also

PDFSM4EncryptString, PDFSM4EncryptToStream, SM4PadPKCS7