-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.c
More file actions
39 lines (31 loc) · 794 Bytes
/
test.c
File metadata and controls
39 lines (31 loc) · 794 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
35
36
37
38
39
#include "keccak.h"
#include "etherkeys.h"
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
unsigned char addr[ETH_ADD_STR_LEN];
const char *privKey1 = "1122112211221122112211221122112211221122112211221122112211221122";
char *privKey;
int i;
if (argc == 2)
{
privKey = argv[1];
if (strlen(privKey) != strlen(privKey1))
{
printf("Bad privKey input\n");
return -1;
}
}
else
privKey = privKey1;
printf("%s\n", privKey);
etherPrivate2Address(privKey, addr);
for (i = 0; i < ETH_ADD_STR_LEN; i++)
printf("%c", addr[i]);
printf("\n");
return 0;
}