-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers:crypto:add support for SM2_DSA_SM3 #5912
Conversation
Please update the commit message to describe accurately what's done. For instance, I can't find drvcrypto_asym_alloc_ecc_public_key anywhere. |
I have updated the commit message. |
@@ -570,6 +580,7 @@ TEE_Result drvcrypt_asym_alloc_ecc_public_key(struct ecc_public_key *key, | |||
|
|||
switch (type) { | |||
case TEE_TYPE_SM2_PKE_PUBLIC_KEY: | |||
case TEE_TYPE_SM2_DSA_PUBLIC_KEY: | |||
key->curve = TEE_ECC_CURVE_SM2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't ecc->alloc_publickey()
taking care of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ecc->alloc_publickey() can not get key_type(such as TEE_TYPE_SM2_DSA_PUBLIC_KEY) to decide which curve it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crypto_asym_alloc_ecc_keypair()
in core/lib/libtomcrypt/ecc.c
and lib/libmbedtls/core/ecc.c
does that.
It might be worth adding a comment here about why some special treatment is needed.
In the commit message, please |
a50ce17
to
63339e2
Compare
|
Adds TEE_TYPE_SM2_DSA_SM3_PUBLIC_KEY to drvcrypt_asym_alloc_ecc_public_key() and adds TEE_TYPE_SM2_DSA_SM3_KEYPAIR to drvcrypt_asym_alloc_ecc_keypair(). Adds support for TEE_MAIN_ALGO_SM2_DSA_SM3 in ecc_sign and ecc_verify. Signed-off-by: Zexi Yu <yuzexi@hisilicon.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds TEE_TYPE_SM2_DSA_SM3_PUBLIC_KEY to
drvcrypt_asym_alloc_ecc_public_key() and adds
TEE_TYPE_SM2_DSA_SM3_KEYPAIR to drvcrypt_asym_alloc_ecc_keypair(). Adds support for TEE_MAIN_ALGO_SM2_DSA_SM3 in ecc_sign and ecc_verify.