Closed chris-wood closed 1 year ago
An alternative design would be to expose getters that return the internal values. That way they can't be modified with a reference to the struct itself. Would that work?
An alternative design would be to expose getters that return the internal values. That way they can't be modified with a reference to the struct itself. Would that work?
Yes, a function similar to https://github.com/cloudflare/circl/blob/main/hpke/util.go#L71 ~but that returns the objects rather than the identifiers.~
Actually, that function already gives access to the KEM and KeySizes, right?
Indeed it does! I didn't know that function existed. Closing.
Callers construct a Suite from a (KEM, AEAD, KDF) tuple and use it for things like creating senders and receivers, but then they must still keep the tuple elements around if they want to get access to things like the KEM Scheme or the AEAD key size. It would be simpler if the caller could just hang onto a Suite value and then access the KEM, AEAD, and KDF values internally. So this change exports things to make that happen.