File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ func (priv *BLSPrivateKey) Sign(message []byte) (signature Signature, err error)
2727 return (* BLSSignature )(sig ), nil
2828}
2929
30+ func (priv * BLSPrivateKey ) SignAugmented (message []byte ) (signature Signature , err error ) {
31+ sig := minpk .Sign ((* minpk .PrivateKey )(priv ), message , bls .Augmentation )
32+ return (* BLSSignature )(sig ), nil
33+ }
34+
3035func (priv * BLSPrivateKey ) ProvePossession () * BLSSignature {
3136 sig := minpk .Prove ((* minpk .PrivateKey )(priv ))
3237 return (* BLSSignature )(sig )
@@ -89,6 +94,15 @@ func (pub *BLSPublicKey) VerifySignature(sig Signature, message []byte) bool {
8994 }
9095}
9196
97+ func (pub * BLSPublicKey ) VerifySignatureAugmented (sig Signature , message []byte ) bool {
98+ switch sig := sig .(type ) {
99+ case * BLSSignature :
100+ return minpk .Verify ((* minpk .PublicKey )(pub ), message , (* minpk .Signature )(sig ), bls .Augmentation ) == nil
101+ default :
102+ return false
103+ }
104+ }
105+
92106func (pub * BLSPublicKey ) MarshalText () (text []byte , err error ) {
93107 return pub .ToProtocol ().ToBase58 (), nil
94108}
You can’t perform that action at this time.
0 commit comments