Merge pull request #40 from kn0sys/kn0sys-dev

use hex decode for l value derivation
This commit is contained in:
c2m 2024-10-27 11:59:46 +00:00 committed by GitHub
commit 07790b99fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,12 +32,12 @@ pub struct NevekoMessageKeys {
}
/// L value as defined at https://eprint.iacr.org/2008/013.pdf
/// L value as defined at https://datatracker.ietf.org/doc/html/rfc8032#section-5.1
const CURVE_L: &str = "edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010";
pub const ENCIPHER: &str = "ENCIPHER";
fn curve_l_as_big_int() -> BigInt {
BigInt::from_bytes_le(Sign::Plus, CURVE_L.as_bytes())
BigInt::from_bytes_le(Sign::Plus, &hex::decode(CURVE_L).unwrap_or_default())
}
fn big_int_to_string(b: &BigInt) -> String {