crate-crypto / Ed448-Goldilocks

24 stars 12 forks source link

56 or 57-byte encoding for Scalars? #24

Closed conradoplg closed 1 year ago

conradoplg commented 1 year ago

As I mentioned in #23 I wanted to make Scalar::to/from_bytes also take/return 57-byte arrays to make it easier to work with EdDSA since RFC 8032 encodes scalars as 57-byte arrays.

I gave it a shot but that makes the X448 implementation akward because RFC 7748 encodes scalar as 56-byte arrays :smiling_face_with_tear:

This is not a huge deal, we can leave this as-is and that should be good enough, but here are some possible ideas:

kevaundray commented 1 year ago

Hey, thanks for checking this out :)

I'd opt for either leaving as is, or adding a new method, so it doesn't break anything, maybe something like to_bytes_rfc_8032 ?

Will delegate that decision to you!