25 lines
513 B
C
25 lines
513 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
|
|
#include "gcl.h"
|
|
|
|
|
|
int main() {
|
|
int msgLen = 10*1024*1024;
|
|
char *msg = malloc(msgLen);
|
|
char digest[32];
|
|
|
|
clock_t start, end;
|
|
int count = 100;
|
|
start = clock();
|
|
for (int i = 0; i < count; i++) {
|
|
sm3(msg, msgLen, &digest);
|
|
}
|
|
end = clock();
|
|
printf("sm3: %.1fMBps\n", (double)count * msgLen/1024/1024/ ((double)(end - start) / CLOCKS_PER_SEC));
|
|
free(msg);
|
|
return 0;
|
|
}
|