Argyle-Software / kyber

A rust implementation of the Kyber post-quantum KEM
https://docs.rs/pqc_kyber/
Apache License 2.0
164 stars 37 forks source link

Expose CPA primitives #31

Closed tbrezot closed 1 year ago

tbrezot commented 1 year ago

Hello,

We are working on the hybridization of our scheme. We are using your library because it allows compiling to WASM. However, we would like to be able to use the CPA-Kyber primitives.

Could you consider making the reference module public?

Regards,

mberry commented 1 year ago

Hi, I've look through your repo and can't tell what primitives you are needing, which module/s in particular?

Regardless, I'm fine with this, but would put it behind a hazmat feature gate with some usage warning to expose internals.

tbrezot commented 1 year ago

Hey, thank your answer.

I would need the primitives of IND-CPA Kyber that are in reference::indcpa. Namely, indcpa_keypair, indcpa_enc and indcpa_dec.

Sure I agree this should not be exposed by default.

I forked your repo waiting for this change to be made upstream. I would propose a MR but it seems your editor leaves trailing spaces at the end of lines (while mine removes them on save) and that you are not using rustfmt so it is a bit tedious to get clean diffs...

Would you consider sticking to the rustfmt format or indicating how to format your code the way you do (I couldn't find it in your readme)?

Apart from exposing these primitives, I think I have spotted deprecated documentations which refer to KYBER_INDCPA_MSGBYTES when no constant is declared with this name in the crate. As I understood, it should be replaced by KYBER_SYMBYTES.

tbrezot commented 1 year ago

I have exposed the primitives in #36

tbrezot commented 1 year ago

Solved in #36