BLS签名(含库函数)

介绍

这是一个BLS签名的go语言库

安装

请参考github主页安装教程

使用

教程

func main() {
   	BLS.BLS_start() 
   	privKey,pubKey:=BLS.Generate_bls_keypair()    
   	signature :=BLS.Bls_signature([]byte("hello") ,privKey)      
   	sibyte:=BLS.SetSIGIntoByte(signature)     
   	sign:=BLS.SetPubKeyFromByte(sibyte)     
   	BLS.Bls_verify([]byte("hello") ,pubKey,sign)      
   }

函数

  func BLS_start()                 
    Generate_bls_keypair()(*pbc.Element,*pbc.Element)    
    Bls_signature(message  []byte,privkey *pbc.Element) *pbc.Element  
    Bls_verify(message  []byte,pubkey  *pbc.Element,signature  *pbc.Element)bool  
    func SetPriKeyIntoByte(privkey  *pbc.Element)[]byte    
    func SetPriKeyFromByte(privkey  []byte)*pbc.Element
    func SetPubKeyIntoByte(pubkey  *pbc.Element)[]byte
    func SetPubKeyFromByte(pubkey  []byte)*pbc.Element
    func SetSIGIntoByte(sig  *pbc.Element)[]byte
    func SetSIGFromByte(sig  []byte)*pbc.Element

说明

在这里插入图片描述在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_37719047/article/details/83305418
今日推荐