-
Notifications
You must be signed in to change notification settings - Fork 66
deprecate the use of some mathlib curves #1203 #1204
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
Conversation
ebdcc92
to
a1fa6f9
Compare
@ale-linux @mbrandenburger , after this gets in, I'll rework #1147 to test for race conditions the curves we use. |
87b7be1
to
ee53699
Compare
0273b97
to
ea48e72
Compare
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.
Great PR! Thanks @adecaro
|
||
"github.com/IBM/idemix" | ||
math3 "github.com/IBM/mathlib" | ||
mathlib "github.com/IBM/mathlib" |
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.
probably this alias is not even needed anymore
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.
it does because the go module has mathlib but the files have math as package
DefaultTMSOpts: common.TMSOpts{TokenSDKDriver: fabtokenv1.DriverIdentifier}, | ||
SDKs: []nodepkg.SDK{&ffabtoken.SDK{}}, | ||
FSCLogSpec: "token-sdk=debug:fabric-sdk=debug:info", | ||
// FSCLogSpec: "debug", |
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.
this looks very repetitive; maybe worth refactoring in another PR
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.
okay
@@ -0,0 +1 @@ | |||
Z�QH�"��>�!C�D;�F�>cP�jy��5 No newline at end of file |
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 am wondering why the revocation key is stored as a beautiful pem, whereas the issuer keys are dumped into the files are pure binary.
package testdata | ||
|
||
//go:generate idemixgen ca-keygen --output ./bls12_381_bbs/ca --curve BLS12_381_BBS --aries | ||
//go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs/ca --output ./bls12_381_bbs/idemix --admin -u example.com -e alice -r 150 --curve BLS12_381_BBS --aries |
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.
--curve BLS12_381_BBS
can we use the non-gurvey curve here because both are compatible?
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.
exactly, they are. I left like this to make sure this remains
var err error | ||
fakeSigningIdentity = &mock.SigningIdentity{} | ||
ipk, err := os.ReadFile("./testdata/idemix/msp/IssuerPublicKey") | ||
ipk, err := os.ReadFile("./testdata/bls12_381_bbs/idemix/msp/IssuerPublicKey") |
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.
maybe a good idea to move ./testdata/bls12_381_bbs/idemix/
into a constant and use it throughout this test.
|
||
func prepareZKTransfer() (*transfer.Prover, *transfer.Verifier) { | ||
pp, err := v1.Setup(32, nil, math.FP256BN_AMCL) | ||
pp, err := v1.Setup(32, nil, math.BN254) |
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.
this might be another candidate math.BN254
to move into a constant for this package.
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.
done
//go:generate idemixgen ca-keygen --output ./bls12_381_bbs/ca --curve BLS12_381_BBS --aries | ||
//go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs/ca --output ./bls12_381_bbs/idemix --admin -u example.com -e alice -r 150 --curve BLS12_381_BBS --aries |
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 am wondering if the auditor and the validator could share the generated testdata?
tables, | ||
secondcache.NewTyped[bool](5000), | ||
secondcache.NewTyped[[]byte](5000), | ||
cache2.NewNoCache[bool](), |
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.
Just reading this line - I am a bit clueless what is instantiated here a new no cache from the cache2 package?
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.
As this is the constructor NewCachedIdentityStore
, shouldn't it use the ristretto-based cache impl?
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.
good catch, will fix
// therefore we need to check more often before the timeout happens | ||
dbChannel := make(chan common.StatusEvent, 1) | ||
defer close(dbChannel) | ||
|
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.
who is closing the channel?
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.
so, checking the documentation I found that closing should be used just for termination signaling not for resources release. So, closing earlier the channel can generate a panic on the db side when trying to push an event.
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.
LGTM % the my comments above :)
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
…stener is not removed yet due to locking Signed-off-by: Angelo De Caro <[email protected]>
d0f6251
to
182c8ba
Compare
Signed-off-by: Angelo De Caro <[email protected]>
This PR does the following: