PLSM4DecryptBlock

Cryptography

Description

Decrypts one 16-byte SM4 block with an initialised round-key context

Syntax

Delphi

Function PLSM4DecryptBlock(Const Context: TPLSM4Context;
  Const Block: AnsiString): AnsiString;

Parameters

ContextRound-key context initialised by PLSM4InitKey
BlockExactly 16 ciphertext bytes

Return values

The 16 decrypted bytes, or an empty string on a wrong block length or an uninitialised context

Remarks

Part of the pure-Pascal SM4 block cipher (GB/T 32907-2016); the implementation passes the standard single-block vector, the published first round key and the one-million-iteration vector

See also

PLSM4EncryptBlock, PLSM4InitKey, SM4DecryptCBC, SM4DecryptECB