SingingCat 0
application
crypt.c
1#include "main-header.h"
2#include "crypt.h"
3
4uint8_t publickey[uECC_BYTES * 2];
5uint8_t privatekey[uECC_BYTES];
6
7byte keys_computed = 0;
14byte *get_public_key() {
15 if (keys_computed == 0) {
16 uECC_set_rng(&my_random_number_generator);
17 int res = uECC_make_key(publickey, privatekey);
18 if (res == 0) {
19 return NULL;
20 }
21 keys_computed = 1;
22 }
23 return (byte *)&publickey;
24}
25
31int get_public_key_size() {
32 return sizeof(publickey);
33}