Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended Idemix Signature Sig Algorithm #5

Merged
merged 9 commits into from
Nov 5, 2021
Merged

Conversation

adecaro
Copy link
Member

@adecaro adecaro commented Oct 28, 2021

This PR brings:

  • Addition of the EID commitment to the metadata
  • Ability to generate an Idemix signature against an already existing EID commitment and its opening.
  • Ability to verify the audit info against a Nym EID
  • Ability to verify an Idemix Signature and enforce that the Nym EID corresponds to the passed one (no audit verification in this case)

Signed-off-by: Angelo De Caro [email protected]

- Additional of the EID commitment to the metadata
- Ability to generate an Idemix signature against an already existing
EDI commitment and its opening

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
the signature carries the same nymID

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Copy link
Collaborator

@ale-linux ale-linux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx Angelo, a couple of Qs

bccsp/schemes/dlog/crypto/signature.go Outdated Show resolved Hide resolved
bccsp/schemes/dlog/crypto/signature.go Show resolved Hide resolved
bccsp/schemes/dlog/crypto/signature.go Outdated Show resolved Hide resolved
@@ -841,6 +869,28 @@ func (sig *Signature) Ver(
if !Nym_eid.Equals(EidNym) {
return errors.Errorf("signature invalid: nym eid validation failed")
}

if !meta.NymEIDAuditData.Nym.Equals(EidNym) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if meta is nil, or some of the fields you deref?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reversed the variable. This should be safe

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double-check, if you supply a Nil argument to Equals, will it fail gracefully?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this depends on the underlying math library. Anyhow, if a panic happens it is caught in the upper layers.
Anyhow, let me add an explicit check :)

bccsp/schemes/dlog/crypto/signature.go Outdated Show resolved Hide resolved
bccsp/schemes/idemixopts.go Show resolved Hide resolved
Signed-off-by: Angelo De Caro <[email protected]>
Nym_eid := H_a_eid.Mul2(meta.NymEIDAuditData.EID, HRand, meta.NymEIDAuditData.RNymEid)
if !Nym_eid.Equals(EidNym) {
return errors.Errorf("signature invalid: nym eid validation failed")
if len(meta.NymEID) != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole block is untested right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

go.mod Outdated
@@ -7,13 +7,15 @@ require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20210912230133-d1bdfacee922 // indirect
github.com/golang/protobuf v1.3.3
github.com/google/addlicense v1.0.0 // indirect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pls revert these changes? This package is actually not needed, we only use it for the CI run

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

go.mod Outdated
github.com/hyperledger/fabric-protos-go v0.0.0-20210911123859-041d13f0980c
github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.1-0.20210116013205-6990a05d54c2 // includes ErrorContains
github.com/sykesm/zap-logfmt v0.0.2
go.uber.org/zap v1.16.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

- additional tests
- check for nil meta.NymEIDAuditData.Nym

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
@ale-linux ale-linux merged commit fc2a3b9 into main Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants