Conversation
|
I haven't reviewed the implementation or entire API surface, just commenting on the API illustrated in the snippet in the description. I think defaulting to base mode is a good idea. I also think not making the user spell out the generic parameters for the crypto components is nice and makes the usage less noisy. But if we're talking about making the API easier to use: What's difficult is that I have to know statically which KEM, AEAD and KDF I want to use. In my application (https://github.com/divviup/janus) I discover which components to use dynamically at runtime. Some clients want boring NIST curves and AES but others want cool kid curves and ChaCha. I have no way of knowing their preference at compile time so I can't just configure the appropriate specialization of things like This might be exacerbated by Anyway, we wound up writing |
|
@tgeoghegan Ahh I forgot that was the pain point. There’s a chance it makes sense to upstream this, but my main concern is complexity. I think having agile-HPKE as a separate crate makes a lot of sense actually. I wonder if you agree? I am happy to devote time to maintaining |
I can see merits either way but I'm comfortable continuing with the status quo. I think we'd be happy to collaborate on the next major version of |
The existing interface is filled with code noise. Here is the current example in the crate root:
This PR defines a new module called
easythat lets the common case usage (ie the example above) be less noisy. The new example code looks like thisI think this looks a lot better, and answers some complaints I've gotten over the years (not to mention explicitly here in #79). Any opinions?
One interesting point is: I can now just say there is "easy mode" (use this module), and "hard mode" (don't use this module). If that's the distinction, I think I'd be fine reverting the recent change that split every deterministic function into
XandX_with_rng. Lower complexity to maintain.cc @tarcieri @josh-brown-anchor @tgeoghegan @elichai