class xf::security::sm4¶
#include "sm234.hpp"
Overview¶
SM4 encryption / decryption functions.
// fields const ap_uint <8> sbox[256] const ap_uint <32> ck[32] ap_uint <32> rk[36]
Methods¶
keyExtension¶
void keyExtension (ap_uint <128> key)
Genrate extension key used in encryption/decryption.
Parameters:
key | Key. |
encrypt¶
void encrypt ( ap_uint <128> input, ap_uint <128>& output )
encryption function.
Parameters:
input | Input block for encryption. |
output | Output of encrypted block. |
decrypt¶
void decrypt ( ap_uint <128> input, ap_uint <128>& output )
decryption function.
Parameters:
input | Input block for decryption. |
output | Output of decrypted block. |