[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 36/39] crypto: Add SM4 constant parameter CK.
From: |
Lawrence Hunter |
Subject: |
[PATCH 36/39] crypto: Add SM4 constant parameter CK. |
Date: |
Thu, 2 Feb 2023 12:42:27 +0000 |
From: Max Chou <max.chou@sifive.com>
Signed-off-by: Max Chou <max.chou@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
---
crypto/sm4.c | 10 ++++++++++
include/crypto/sm4.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/crypto/sm4.c b/crypto/sm4.c
index 9f0cd452c7..2987306cf7 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
+};
diff --git a/include/crypto/sm4.h b/include/crypto/sm4.h
index 33478562a4..d0df6e473c 100644
--- a/include/crypto/sm4.h
+++ b/include/crypto/sm4.h
@@ -9,5 +9,6 @@
)
extern const uint8_t sm4_sbox[256];
+extern const uint32_t sm4_ck[32];
#endif
--
2.39.1
- [PATCH 28/39] target/riscv: add zvksh cpu property, (continued)
- [PATCH 28/39] target/riscv: add zvksh cpu property, Lawrence Hunter, 2023/02/02
- [PATCH 21/39] target/riscv: Add vaeskf1.vi decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 26/39] target/riscv: Add vsha2c[hl].vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 29/39] target/riscv: Add vsm3me.vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 33/39] target/riscv: Add vghmac.vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 16/39] target/riscv: Add vaesdm.vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 22/39] target/riscv: Add vaeskf2.vi decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 20/39] target/riscv: Add vaesem.vs decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 03/39] target/riscv: Add vclmul.vx decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 36/39] crypto: Add SM4 constant parameter CK.,
Lawrence Hunter <=
- [PATCH 37/39] target/riscv: Add zvksed cfg property, Lawrence Hunter, 2023/02/02
- [PATCH 10/39] target/riscv: expose zvkb cpu property, Lawrence Hunter, 2023/02/02
- [PATCH 09/39] target/riscv: Add vandn.[vv, vx, vi] decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 02/39] target/riscv: Add vclmul.vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 13/39] target/riscv: Add vaesef.vs decoding, translation and execution support, Lawrence Hunter, 2023/02/02
- [PATCH 14/39] target/riscv: Add vaesdf.vv decoding, translation and execution support, Lawrence Hunter, 2023/02/02