Add unlooped version of SM3

This commit is contained in:
Zhi Guan
2024-05-10 00:53:49 +08:00
parent f64b8c5620
commit 48bbce551f

View File

@@ -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;