Uh oh!
There was an error while loading. Please reload this page.
ml-kem: Adds feature flag to use key or seed - #83
Conversation
begin refactor adds feature flag to use key or seed minor fixes to no-default disables acvp tests for seed adds missing conditional reset actions properly handle tests properly negate tests to stop clippy warnings
tarcieri
commented
Jan 7, 2025
Really seeds should be the "default" API, not something that's enabled by a feature. I think it's OK to make breaking changes towards that end. |
supinie
commented
Jan 7, 2025
I can easily swap this around - will put together a new commit now. |
supinie
commented
Jan 10, 2025
I just thought, since we now have two feature flags, is it also worth adding a short section on the docs homepage about them? |
tarcieri
commented
Jan 21, 2025
@supinie I would prefer a PR like this be purely additive, as opposed to changing things depending on if the feature is enabled by using |
supinie
commented
Jan 22, 2025
@tarcieri in that case, would we rather that the DecapsulationKey object is the seed, and we then generate the "inner" key before use, or keep the |
That's a good question. In As things are currently implemented, the seed is always expanded prior to use, and the expanded form is not cached but instead always computed on demand. I think something similar could work here? |
I've refactored it to fit this style, but am unable to get the KATs working ( I have pushed these changes to https://github.com/supinie/KEMs/tree/additive so you can take a look if you'd like. |
supinie
commented
Mar 14, 2025
I've been thinking a little more about this problem recently, perhaps we could use an enum to hold either the key as a seed or the key as an inner. The enum would ensure that only one can be set at a time, with a preference towards using the seed, but in some cases would allow us to carry around the old inner key instead? |
dignifiedquire
commented
Apr 5, 2025
I personally would like to be able to use both, especially without having feature flag usage. |
supinie
commented
Apr 7, 2025
When I'm saying "use both", I'm talking internally, an external user would just see a key object. We wouldn't want or need to store both internally as they just do the same thing. Please correct me if I've misunderstood, but @tarcieri would also like it to be this way; the flag simply allows you to gain access to the old API |
tarcieri
commented
Oct 24, 2025
Closing in favor of #133 |
Resolves#53
I saw that @bifurcation mentioned that the test vectors should work, but they appeared to be in the wrong format. For now I have disabled them in the same way that
deterministicdoes.I have tried to write it in such a way that the user always deals with a
DecapsulationKeytype no matter whether this is a true key or seed to maximise backwards compatibility.