Closed tarcieri closed 1 year ago
Alternatively (and alternatively to #541) we could get rid of the to_bytes
method, which seems to be the reason for retaining it in the first place.
I'm not sure what the motivation is for having it at all. Serializing this format on the wire is an antipattern, IMO.
I opened #545 as an alternative to this PR to try just getting rid of the private field, which makes all of the fields pub
now and allows for public construction of ExpandedSecretKey
again
Superseded by #545
Motivation can be found in this comment:
https://github.com/dalek-cryptography/ed25519-dalek/pull/293#pullrequestreview-1507115602
Replaces public fields with private fields + accessor methods.
Also adds an
ExpandedSecretKey::from_scalar_and_prefix
constructor which makes it possible to constructExpandedSecretKey
using aScalar
again, which is useful for protocols that derive the scalar such as Ed25519-BIP32.Additionally defines a
HashPrefix
type alias to make it semantically clear which[u8; 32]
is involved in type signatures.