Thanks to visit codestin.com
Credit goes to github.com

Skip to content

I am using the params.String() func but it seems not work #9

@tanzhilangnw

Description

@tanzhilangnw

`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)

}`

image

why the str is empty? can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions