mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-13 11:56:28 +08:00
Add unlooped version of SM3
This commit is contained in:
@@ -185,6 +185,9 @@ static int test_sm3_speed(void)
|
|||||||
double seconds;
|
double seconds;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 4096; i++) {
|
||||||
|
sm3_update(&sm3_ctx, blocks, sizeof(blocks));
|
||||||
|
}
|
||||||
start = clock();
|
start = clock();
|
||||||
sm3_init(&sm3_ctx);
|
sm3_init(&sm3_ctx);
|
||||||
for (i = 0; i < 4096; i++) {
|
for (i = 0; i < 4096; i++) {
|
||||||
@@ -195,7 +198,7 @@ static int test_sm3_speed(void)
|
|||||||
|
|
||||||
seconds = (double)(end - start)/CLOCKS_PER_SEC;
|
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;
|
return 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user