-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
70 lines (53 loc) · 1.14 KB
/
main.go
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
import (
"flag"
"fmt"
"os"
"testing"
"time"
"github.com/alinush/go-mcl"
"github.com/hyperproofs/hyperproofs-go/vcs"
)
func main() {
testing.Init()
flag.Parse()
fmt.Println("Hello, World!")
mcl.InitFromString("bls12-381")
dt := time.Now()
fmt.Println("Specific date and time is: ", dt.Format(time.UnixDate))
fmt.Println(vcs.SEP)
args := os.Args
if len(args) == 1 {
var L uint8
L = uint8(26)
_ = hyperGenerateKeys(L, false)
L = uint8(30)
_ = hyperGenerateKeys(L, true)
} else {
if args[1] == "1" {
snarks_verifier()
} else {
Benchmark() // Uncomment this benchmark Commit and OpenAll.
}
}
}
func hyperGenerateKeys(L uint8, fake bool) *vcs.VCS {
N := uint64(1) << L
vcs := vcs.VCS{}
fmt.Println("L:", L, "N:", N)
folderPath := fmt.Sprintf("pkvk-%02d", L)
if fake {
vcs.KeyGenFake(16, L, folderPath, 1<<12)
} else {
vcs.KeyGen(16, L, folderPath, 1<<12)
}
fmt.Println("KeyGen ... Done")
return &vcs
}
func hyperLoadKeys(L uint8) *vcs.VCS {
folderPath := fmt.Sprintf("pkvk-%02d", L)
vcs := vcs.VCS{}
vcs.KeyGenLoad(16, L, folderPath, 1<<12)
fmt.Println("KeyGenLoad ... Done")
return &vcs
}