From: Chenghai Huang <huangchenghai2(a)huawei.com>
The following 17 AES algorithms are added:
AES-128-CBC AES-192-CBC AES-256-CBC AES-128-ECB AES-192-ECB
AES-256-ECB AES-128-XTS AES-256-XTS AES-128-CTR AES-192-CTR
AES-256-CTR AES-128-OFB AES-192-OFB AES-256-OFB AES-128-CFB
AES-192-CFB AES-256-CFB
Signed-off-by: Chenghai Huang <huangchenghai2(a)huawei.com>
Signed-off-by: JiangShui Yang <yangjiangshui(a)h-partners.com>
---
src/uadk_prov.h | 33 ++++++++++++++++++++++-----------
src/uadk_prov_init.c | 26 +++++++++++++++++++++++++-
2 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/src/uadk_prov.h b/src/uadk_prov.h
index 1b4816e..3655437 100644
--- a/src/uadk_prov.h
+++ b/src/uadk_prov.h
@@ -128,17 +128,28 @@ extern const OSSL_DISPATCH uadk_sha512_functions[FUNC_MAX_NUM];
extern const OSSL_DISPATCH uadk_sha512_224_functions[FUNC_MAX_NUM];
extern const OSSL_DISPATCH uadk_sha512_256_functions[FUNC_MAX_NUM];
-
-extern const OSSL_DISPATCH uadk_aes_128_cbc_functions[];
-extern const OSSL_DISPATCH uadk_aes_192_cbc_functions[];
-extern const OSSL_DISPATCH uadk_aes_256_cbc_functions[];
-extern const OSSL_DISPATCH uadk_aes_128_ecb_functions[];
-extern const OSSL_DISPATCH uadk_aes_192_ecb_functions[];
-extern const OSSL_DISPATCH uadk_aes_256_ecb_functions[];
-extern const OSSL_DISPATCH uadk_aes_128_xts_functions[];
-extern const OSSL_DISPATCH uadk_aes_256_xts_functions[];
-extern const OSSL_DISPATCH uadk_sm4_cbc_functions[];
-extern const OSSL_DISPATCH uadk_sm4_ecb_functions[];
+extern const OSSL_DISPATCH uadk_aes_128_cbc_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_192_cbc_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_cbc_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_128_ecb_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_192_ecb_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_ecb_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_128_xts_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_xts_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_128_ctr_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_192_ctr_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_ctr_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_128_ofb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_192_ofb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_ofb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_128_cfb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_192_cfb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_aes_256_cfb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_sm4_cbc_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_sm4_ecb_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_sm4_ofb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_sm4_cfb128_functions[FUNC_MAX_NUM];
+extern const OSSL_DISPATCH uadk_sm4_ctr_functions[FUNC_MAX_NUM];
extern const OSSL_DISPATCH uadk_des_ede3_cbc_functions[];
extern const OSSL_DISPATCH uadk_des_ede3_ecb_functions[];
diff --git a/src/uadk_prov_init.c b/src/uadk_prov_init.c
index 52a5da0..05a1b9f 100644
--- a/src/uadk_prov_init.c
+++ b/src/uadk_prov_init.c
@@ -89,10 +89,34 @@ const OSSL_ALGORITHM uadk_prov_ciphers[] = {
uadk_aes_128_xts_functions, "uadk_provider aes-128-xts" },
{ "AES-256-XTS", UADK_DEFAULT_PROPERTIES,
uadk_aes_256_xts_functions, "uadk_provider aes-256-xts" },
- { "SM4-CBC:SM4", UADK_DEFAULT_PROPERTIES,
+ { "AES-128-CTR", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_128_ctr_functions, "uadk_provider aes-128-ctr" },
+ { "AES-192-CTR", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_192_ctr_functions, "uadk_provider aes-192-ctr" },
+ { "AES-256-CTR", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_256_ctr_functions, "uadk_provider aes-256-ctr" },
+ { "AES-128-OFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_128_ofb128_functions, "uadk_provider aes-128-ofb" },
+ { "AES-192-OFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_192_ofb128_functions, "uadk_provider aes-192-ofb" },
+ { "AES-256-OFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_256_ofb128_functions, "uadk_provider aes-256-ofb" },
+ { "AES-128-CFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_128_cfb128_functions, "uadk_provider aes-128-cfb" },
+ { "AES-192-CFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_192_cfb128_functions, "uadk_provider aes-192-cfb" },
+ { "AES-256-CFB", UADK_DEFAULT_PROPERTIES,
+ uadk_aes_256_cfb128_functions, "uadk_provider aes-256-cfb" },
+ { "SM4-CBC", UADK_DEFAULT_PROPERTIES,
uadk_sm4_cbc_functions, "uadk_provider sm4-cbc" },
{ "SM4-ECB", UADK_DEFAULT_PROPERTIES,
uadk_sm4_ecb_functions, "uadk_provider sm4-ecb" },
+ { "SM4-OFB", UADK_DEFAULT_PROPERTIES,
+ uadk_sm4_ofb128_functions, "uadk_provider sm4-ofb" },
+ { "SM4-CFB", UADK_DEFAULT_PROPERTIES,
+ uadk_sm4_cfb128_functions, "uadk_provider sm4-cfb" },
+ { "SM4-CTR", UADK_DEFAULT_PROPERTIES,
+ uadk_sm4_ctr_functions, "uadk_provider sm4-ctr" },
{ "DES-EDE3-CBC", UADK_DEFAULT_PROPERTIES,
uadk_des_ede3_cbc_functions, "uadk_provider des-ede3-cbc" },
{ "DES-EDE3-ECB", UADK_DEFAULT_PROPERTIES,
--
2.33.0