-
Notifications
You must be signed in to change notification settings - Fork 1
/
num.cpp
41 lines (33 loc) · 826 Bytes
/
num.cpp
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
40
41
// num.cpp
#include "nummer.hpp"
#include "num.h"
#include <stdio.h>
void DoSomething(void *p, int size) {
// char* ptr = (char*)p;
// printf("hello world : %d\n", *ptr);
uint8_t* ptr = (uint8_t*)p;
// printf("hello world : %d\n", *ptr);
for (int i = 0 ; i < size; i++) {
printf("hello world : %d\n", ptr[i]);
}
// bls::PrivateKey sk = bls::PrivateKey::FromSeed(seed, sizeof(seed));
// bls::PublicKey pk = sk.GetPublicKey();
printf("size : %d\n", size);
return;
}
Num NumInit() {
cxxNum * ret = new cxxNum(1);
return (void*)ret;
}
void NumFree(Num n) {
cxxNum * num = (cxxNum*)n;
delete num;
}
void NumIncrement(Num n) {
cxxNum * num = (cxxNum*)n;
num->Increment();
}
int NumGetValue(Num n) {
cxxNum * num = (cxxNum*)n;
return num->GetValue();
}