-
Notifications
You must be signed in to change notification settings - Fork 162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2278 +/- ##
==========================================
- Coverage 89.90% 89.87% -0.04%
==========================================
Files 226 227 +1
Lines 15239 15327 +88
==========================================
+ Hits 13701 13775 +74
- Misses 910 917 +7
- Partials 628 635 +7
Continue to review full report at Codecov.
|
df02ecc
to
c3bad9f
Compare
pkg/doc/bbs/bbs12381g2pub/bbs.go
Outdated
for i := range messages { | ||
messagesFr[i], err = ParseSignatureMessage(messages[i]) | ||
if err != nil { | ||
return nil, fmt.Errorf("parse signature message: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the index i
in the error message to help troubleshoot errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved.
pkg/doc/bbs/bbs12381g2pub/bbs.go
Outdated
} | ||
|
||
// SignWithKeyPair signs the one or more messages using BBS+ key pair. | ||
func (bbs *BBSG2Pub) SignWithKeyPair(messages [][]byte, privKey *PrivateKey, pubKey *PublicKey) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't privKey
include the public key as well ? can't we just pass privKey alone then do privKey.PublicKey() inside the function to fetch its public key?
what happens if someone passes a public key not matching the private one? I think its unnecessary to pass pubKey to this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this point. No need to pass a pubKey
as it's created from privKey
by a straightforward algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected the API.
pkg/doc/bbs/api.go
Outdated
// returns: | ||
// error in case of errors or nil if signature verification was successful | ||
Verify(messages [][]byte, signature, pubKey []byte) error | ||
|
||
// Sign will sign create signature of each message and aggregate it into a single signature using | ||
// a matching signature primitive in kh key handle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privKey
is a raw key, not a handle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
Signed-off-by: Dmitriy Kinoshenko <[email protected]>
This PR provides an implementation of BBS+ signer. It also provides a generator of public/private key pair. We can now generate a key pair, sing one or more messages, and verify the created signature (this functionality was already present).
Signed-off-by: Dmitriy Kinoshenko [email protected]
Relates to #2222 . To close this issue, in the follow-up PR we will use the BBS+ signer for VC.