-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path00err.c
More file actions
34 lines (26 loc) · 698 Bytes
/
00err.c
File metadata and controls
34 lines (26 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <openssl/sha.h>
#include "lib.h"
int main(int argc, char* argv[])
{
int seed = atoi(argv[2]), i, n = atoi(argv[1]), k;
unsigned char *s, *h;
srand(seed);
for(i=0;i<50;i++){
s = randhexstring(n);
if((i/2)%2==0){
k = rand()%n;
s[k] = 0;
}
h = (unsigned char*) bytehash(n, (unsigned char*) s);
printhash(n, (unsigned char*) s);
printf("-->");
printhash(n, (unsigned char*) h);
printf(" %d\n", find00(n, (unsigned char*) s));
}
return 0;
}