I am using the params.String() func but it seems not work
Opened this issue · 0 comments
tanzhilangnw commented
`func init() {
file.FileRemove("params")
file.FileRemove("groupPublicKey")
file.FileRemove("groupPrivateKey")
params := pbc.GenerateA(160, 512)
//params := pbc.GenerateE(160,1024)
// serialization params
str := params.String()
file.Byte2File("params", []byte(str))
str1 := file.File2Byte("params")
pairing, _ := pbc.NewPairingFromString(string(str1))
// get g1 and g2
g1 := pairing.NewG1().Rand()
g2 := pairing.NewG2().Rand()
privateKey := bbs.GenerateGroup(g1, g2, pairing)
// 编码群公钥,转换成byte数组
groupPK := bbs.EncodeGroup(privateKey.Group)
groupPrivateKey := bbs.EncodePrivateKey(privateKey)
file.Byte2File("groupPublicKey", groupPK)
file.Byte2File("groupPrivateKey", groupPrivateKey)
}`
why the str is empty? can you help me?