Closed nic-hartley closed 4 years ago
The current Rust API for key exchange could be improved.
Instead of calling a static function for each step, supplying parameters from the previous step, each intermediate state could return its own type. This would make the API less close to the original C API, but easier and safer to use.
This is why a new version hasn't been released with the current code. It's not finished.
Fair enough. Any chance you're looking for help? I wouldn't feel confident poking at the actual crypto code but I can probably write a decent wrapper :)
Sure, help would be more than welcome! Especially to make this look more like idiomatic Rust!
Cool, I can poke at it today! Can't make any guarantees about it, though, lol.
Started poking at this and I've got an idea for a fairly clean API, but it's probably gonna take a lil while longer to actually implement it. I'll probably submit a PR early, before it's really ready, so you can comment on it.
Currently thinking of actually splitting kx into submodules, one per type of kx (so there'd be kx::n
, kx::kk
, kx::xx
, each referencing kx::PublicKey
, kx::SecretKey
, etc.) to keep the names of the various "packet"/state types I'm using cleaner. Idk, it could go either way, between that and just prepending N
/KK
/XX
to type names.
The rest of the structure is pretty bog-standard, but I'll refrain from explaining it until I've got something at least partly complete, lol
Hey! I'm looking to use libhydrogen for an embedded project of mine, but it looks like KX hasn't been pushed out yet -- what's left to do? I can see it in the actual source and at a glance it seems complete, but it's not in the docs.