Closed StackOverflowExcept1on closed 2 months ago
I'm using blake2 in no_std environment and it's quite strange that panic can occur in the release build. This increases the size of the output binary file.
blake2/src/macros.rs: assert!(key_size <= $bytes::to_usize()); blake2/src/macros.rs: assert!(output_size <= $bytes::to_usize()); blake2/src/macros.rs: assert!(salt.len() <= length); blake2/src/macros.rs: assert!(persona.len() <= length); sha3/src/macros.rs: assert!((0x01..=0x7F).contains(&domain_separation));
You can also consider compile time assertions:
const _: () = assert!(42 <= 1024); //ok const _: () = assert!(42 > 1024); //compile error
All those asserts check user-provided values. Their validity is important for algorithm correctness, so using debug asserts would be incorrect here.
I'm using blake2 in no_std environment and it's quite strange that panic can occur in the release build. This increases the size of the output binary file.
You can also consider compile time assertions: