From 48bbce551f9ca46fe3045f739e7c182c6bd3e00e Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Fri, 10 May 2024 00:53:49 +0800 Subject: [PATCH] Add unlooped version of SM3 --- tests/sm3test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/sm3test.c b/tests/sm3test.c index b58b0174..84623aa2 100644 --- a/tests/sm3test.c +++ b/tests/sm3test.c @@ -185,6 +185,9 @@ static int test_sm3_speed(void) double seconds; int i; + for (i = 0; i < 4096; i++) { + sm3_update(&sm3_ctx, blocks, sizeof(blocks)); + } start = clock(); sm3_init(&sm3_ctx); for (i = 0; i < 4096; i++) { @@ -195,7 +198,7 @@ static int test_sm3_speed(void) seconds = (double)(end - start)/CLOCKS_PER_SEC; - fprintf(stderr, "sm3 on 16-MiB : time %f seconds : %f MiB per second\n", seconds, 16/seconds); + fprintf(stderr, "%s: %f MiB per second\n", __FUNCTION__, 16/seconds); return 1;