Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90965630
crypto_javascript.go
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 11:34
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Nov 8, 11:34 (2 d)
Engine
blob
Format
Raw Data
Handle
22168832
Attached To
R2664 SHRINE MedCo Fork
crypto_javascript.go
View Options
package
main
import
(
"github.com/gopherjs/gopherjs/js"
"./mylib"
//"./mappingTable"
//"io/ioutil"
//"os"
)
// USE:
// unlynx: branch newI2B2
// onet: branch master
func
main
()
{
//--> transpile the functions: gopherjs build -m crypto_javascript.go -o cryptolib.js
transpileFunctions
()
// --> compute the aggregate key of the cothority
// given file path
//rosterFilePath := "src/main/tools/gopherjsCrypto/group.toml"
//println(mylib.AggregateKeysFromFile(rosterFilePath))
//--> check how big is the mapping table
//print(len(mappingTable.PointToInt))
}
func
transpileFunctions
(){
js
.
Global
.
Set
(
"AggKeys"
,
mylib
.
AggregateKeys
)
//js.Global.Set("AggKeysFromFile", mylib.AggregateKeysFromFile) // not working, in javascript you can read a file only after a GET request
js
.
Global
.
Set
(
"GenKey"
,
mylib
.
GenKey
)
js
.
Global
.
Set
(
"EncryptStr"
,
mylib
.
EncryptStr
)
js
.
Global
.
Set
(
"DecryptStr"
,
mylib
.
DecryptStr
)
// also the light encryption
js
.
Global
.
Set
(
"LightEncryptStr_init"
,
mylib
.
LightEncryptStr_init
)
js
.
Global
.
Set
(
"LightEncryptStr"
,
mylib
.
LightEncryptStr
)
}
Event Timeline
Log In to Comment