dedis / kyber

Advanced crypto library for the Go language
Other
641 stars 168 forks source link

Expose primeOrder #259

Open jeffallen opened 6 years ago

jeffallen commented 6 years ago

From dedis/onet#256: Would it be possible to add a function to get the cardinality of the elliptic curve that is used ?

jeffallen commented 6 years ago

David says: I would just need to be able to access primeOrder and primeOrderScalar or just (primeOrderScalar) that are in group/edwards25519/const.go. so maybe just an uppercase ? :slightly_smiling_face:

nikkolasg commented 6 years ago

I would maybe suggest that david makes a copy of that variable inside his own code if "Only wants that value" and not the cardinality for all possible groups. Only a suggestion...

ineiti commented 6 years ago

In Javascript and Java I had to access that value for different reasons, so it is definitively something that will be used if it's exposed. Can we put that into some generic parameter-readonly field or a method?

bford commented 6 years ago

It might be worth adding an (optional) interface somewhere by which a caller can query multiple curve parameters that may be of interest in different circumstances, such as (a) the curve order, (b) the order of the underlying field used in the curve's representation, (c) the large prime and cofactor (possibly 1) comprising the curve's order.

jeffallen commented 6 years ago

It is not clear enough what we expect here, and there are easy workarounds if David needs them. So not going in kyber v1.

pierluca commented 1 year ago

It seems that the use cases discussed in this issue have found workarounds.

@si-co do you think we should leave this open, or shall we close it as part of the ongoing clean-up ?

si-co commented 1 year ago

The optional interface proposed by @bford would be useful and not difficult to implement, but since there are workarounds and given the multiple urgent issues in the repo I'd close (for now).