Colfenor / classic-mceliece-rust

This is a pure-rust safe-rust implementation of the Classic McEliece post-quantum scheme
MIT License
24 stars 11 forks source link

Add kem-API tests and move non kem-API interface related tests out of kem module #39

Closed faern closed 1 year ago

faern commented 1 year ago

Some tests not related to the kem feature were still placed in the kem_api module. Meaning they would only run if the kem feature was active (which it is not in the CI). So I moved them out to the regular test module and made sure they work. For the tests running on the stack we must run it in a separate thread until we get the stack usage under control.

I also added a test that verifies that the CryptoCiphertextBytesTypenum always corresponds to CRYPTO_CIPHERTEXTBYTES since the CI passed when this was set wrong over in #33. This should help catch such errors.

Colfenor commented 1 year ago

Hi @faern thank you for the clarification and adding these unit tests + refactor.

I read your response at #34 & I agree that CryptoCiphertextBytesTypenum only affects the from_bytes implementation on the EncappedKey. Initially I thought that it affected the key encapsulation methods of kem but this does not seem to be the case.