PLSM4EncryptBlock
Cryptography
Description
Encrypts one 16-byte SM4 block with an initialised round-key context
Syntax
Delphi
Function PLSM4EncryptBlock(Const Context: TPLSM4Context;
Const Block: AnsiString): AnsiString;Parameters
| Context | Round-key context initialised by PLSM4InitKey |
|---|---|
| Block | Exactly 16 plaintext bytes |
Return values
| The 16 encrypted 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
PLSM4DecryptBlock, PLSM4InitKey, SM4EncryptCBC, SM4EncryptECB