init: v1.0.0
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user