summaryrefslogtreecommitdiff
path: root/core/lib
diff options
context:
space:
mode:
authorJerome Forissier <jerome@forissier.org>2019-12-17 09:19:56 +0100
committerJérôme Forissier <jerome@forissier.org>2020-01-09 09:17:39 +0100
commit0f1519439f5bff0608f4a24baaaed108a0d0be5c (patch)
tree88fa84c7bef3d4986e7b80c522c303a629e26634 /core/lib
parent76c7ba4b9ff76dc053e34ad9f9c790a6c59febf5 (diff)
core: crypto add support for SM2 DSA
Adds SM2 Digital Signature Algorithm [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2. SM2 DSA is enabled with CFG_CRYPTO_SM2_DSA=y (default y) which currently requires that CFG_CRYPTOLIB_NAME=tomcrypt. An Mbed TLS implementation could be added later if needed. [1] http://www.gmbz.org.cn/main/postDetail.html?id=20180724110812 Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/lib')
-rw-r--r--core/lib/libtomcrypt/ecc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/lib/libtomcrypt/ecc.c b/core/lib/libtomcrypt/ecc.c
index 051da77e..92d773af 100644
--- a/core/lib/libtomcrypt/ecc.c
+++ b/core/lib/libtomcrypt/ecc.c
@@ -128,7 +128,8 @@ static TEE_Result ecc_get_curve_info(uint32_t curve, uint32_t algo,
size_bits = 256;
size_bytes = 32;
name = "SM2";
- if ((algo != 0) && (algo != TEE_ALG_SM2_PKE))
+ if ((algo != 0) && (algo != TEE_ALG_SM2_PKE) &&
+ (algo != TEE_ALG_SM2_DSA_SM3))
return TEE_ERROR_BAD_PARAMETERS;
break;
default: