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

compile time error for no_std #49

Closed oilel closed 1 year ago

oilel commented 1 year ago

use pqc_kyber::*; fn main(){ let mut rng = rand::thread_rng(); let pair = keypair(&mut rng); let (ct, ss) = encapsulate(&pair.public, &mut rng)?; }

[panic_handler]

fn my_panic(_info: &core::panic::PanicInfo) -> ! { loop {} }

[lang = "eh_personality"]

extern "C" fn eh_personality() {}

Still get compile time error: error: #[panic_handler] function required, but not found

error: language item required, but not found: eh_personality | = note: this can occur when a binary crate with #![no_std] is compiled for a target where eh_personality is defined in the standard library = help: you may be able to compile for a target that doesn't need eh_personality, specify a target with --target or in .cargo/config

oilel commented 1 year ago

I use Termux, a terminal emulator for Android, on ARM64.

mberry commented 1 year ago

Is this with the std feature enabled for Kyber?

oilel commented 1 year ago

Is this with the std feature enabled for Kyber?

No.

mberry commented 1 year ago

Enable std and you should be fine. Please update if there's any more problems.

I should make a note somewhere in the readme about no_std and exception handling.

mberry commented 1 year ago

Is this still causing any problems?

oilel commented 1 year ago

Is this still causing any problems?

No.