-
Notifications
You must be signed in to change notification settings - Fork 0
/
wasm.go
30 lines (26 loc) · 1008 Bytes
/
wasm.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
//go:build js && wasm
// +build js,wasm
package main
import (
"syscall/js"
"he_wasm/fame"
"he_wasm/signatures"
)
func registerCallback() {
js.Global().Set("AheGenerateMasterKeys", js.FuncOf(fame.Go_Ahe_fame_GenerateMasterKeys))
js.Global().Set("AheGenerateAttribKeys", js.FuncOf(fame.Go_Ahe_fame_GenerateAttribKeys))
js.Global().Set("AheEncrypt", js.FuncOf(fame.Go_Ahe_fame_Encrypt))
js.Global().Set("AheDecrypt", js.FuncOf(fame.Go_Ahe_fame_Decrypt))
js.Global().Set("AheDecrytAttribKeys", js.FuncOf(fame.Go_Ahe_fame_DecrytAttribKeys))
js.Global().Set("AheJoinDecAttribKeys", js.FuncOf(fame.Go_Ahe_fame_JoinDecAttribKeys))
js.Global().Set("AheGenerateSignKeys", js.FuncOf(signatures.Go_Ahe_GenerateSignKeys))
js.Global().Set("AheSignCiphers", js.FuncOf(signatures.Go_Ahe_SignCiphers))
js.Global().Set("AheVerifyCiphers", js.FuncOf(signatures.Go_Ahe_VerifyCiphers))
}
func main() {
c := make(chan struct{}, 0)
// register functions
registerCallback()
println("WASM Go Initialized")
<-c
}