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
xtest: add SM2 perf test #739
Conversation
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.
@yuzexiyzx, usage()
needs to be updated for these new cmdline options.
@@ -904,6 +904,25 @@ int asym_perf_runner_cmd_parser(int argc, char *argv[]) | |||
main_algo = ALGO_X25519; | |||
width_bits = 256; | |||
mode = MODE_GENKEYPAIR; | |||
} else if (!strcasecmp(argv[i], "SM2_GENKEYPAIR")) { |
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.
Don't you need to provide the main_algo
info to generate an SM2 keypair?
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.
solved
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.
I don't know much about SM2 but it seems the key type differs if used for ciphering and authentication (TEE_TYPE_SM2_DSA_KEYPAIR
vs TEE_TYPE_SM2_PKE_KEYPAIR
). Here we don't knw what the key will be used for, is that ok?
(resolved: answered by #739 (comment))
host/xtest/asym_perf.c
Outdated
@@ -957,7 +976,7 @@ int asym_perf_runner_cmd_parser(int argc, char *argv[]) | |||
} | |||
} | |||
|
|||
if (mode == MODE_GENKEYPAIR) | |||
if (mode == MODE_GENKEYPAIR || main_algo >= ALGO_SM2_PKE) |
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.
prefer explicit matching main_algo
values:
if (mode == MODE_GENKEYPAIR || main_algo >= ALGO_SM2_PKE ||
main_algo >= ALGO_SM2_DSA_SM3)
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.
solved
46e5fbb
to
057db93
Compare
@etienne-lms All comments have been solved. |
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.
LGTM.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
if this new comment is out of scope.
This change modifies asym performance test TA API, but I think it's ok we don't enfore backward compat on OP-TEE Test TAs ABI.
@@ -904,6 +904,25 @@ int asym_perf_runner_cmd_parser(int argc, char *argv[]) | |||
main_algo = ALGO_X25519; | |||
width_bits = 256; | |||
mode = MODE_GENKEYPAIR; | |||
} else if (!strcasecmp(argv[i], "SM2_GENKEYPAIR")) { |
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.
I don't know much about SM2 but it seems the key type differs if used for ciphering and authentication (TEE_TYPE_SM2_DSA_KEYPAIR
vs TEE_TYPE_SM2_PKE_KEYPAIR
). Here we don't knw what the key will be used for, is that ok?
(resolved: answered by #739 (comment))
@etienne-lms This is used for both TEE_TYPE_SM2_DSA_KEYPAIR and TEE_TYPE_SM2_PKE_KEYPAIR |
add perf test for SM2 algorithm Signed-off-by: Zexi Yu <yuzexi@hisilicon.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
@jforissier All comments have been solved. |
@jforissier, LGTM. Note the test TA API change. I think it's ok we don't enfore backward compat on OP-TEE Test TAs ABI. Ok with you? |
Yes it's fine. |
add perf test for SM2 algorithm