kyber icon indicating copy to clipboard operation
kyber copied to clipboard

Expose primeOrder

Open jeffallen opened this issue 7 years ago • 7 comments

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

jeffallen avatar Dec 07 '17 09:12 jeffallen

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:

jeffallen avatar Dec 07 '17 10:12 jeffallen

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...

nikkolasg avatar Dec 07 '17 10:12 nikkolasg

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?

ineiti avatar Dec 07 '17 11:12 ineiti

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.

bford avatar Dec 07 '17 13:12 bford

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

jeffallen avatar Dec 12 '17 10:12 jeffallen

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 ?

pierluca avatar Nov 25 '22 14:11 pierluca

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).

si-co avatar Nov 28 '22 15:11 si-co