aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMax Chou <max.chou@sifive.com>2023-07-12 00:59:13 +0800
committerAlistair Francis <alistair.francis@wdc.com>2023-09-11 11:45:55 +1000
commitf5f3a9152ae1242f5d1113852aa97d13b382815b (patch)
tree60c2caf60f8bf41459b05204c6ce5a7048d8eba3 /crypto
parentf6ef550fe5c915d1d74ce9854280d16a8d71e230 (diff)
downloadqemu-f5f3a9152ae1242f5d1113852aa97d13b382815b.zip
qemu-f5f3a9152ae1242f5d1113852aa97d13b382815b.tar.gz
qemu-f5f3a9152ae1242f5d1113852aa97d13b382815b.tar.bz2
crypto: Add SM4 constant parameter CK
Adds sm4_ck constant for use in sm4 cryptography across different targets. Signed-off-by: Max Chou <max.chou@sifive.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Signed-off-by: Max Chou <max.chou@sifive.com> Message-ID: <20230711165917.2629866-15-max.chou@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/sm4.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/sm4.c b/crypto/sm4.c
index 9f0cd45..2987306c 100644
--- a/crypto/sm4.c
+++ b/crypto/sm4.c
@@ -47,3 +47,13 @@ uint8_t const sm4_sbox[] = {
0x79, 0xee, 0x5f, 0x3e, 0xd7, 0xcb, 0x39, 0x48,
};
+uint32_t const sm4_ck[] = {
+ 0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269,
+ 0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9,
+ 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249,
+ 0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9,
+ 0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229,
+ 0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299,
+ 0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209,
+ 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279
+};