fix for the jokester that added unreduced scalars

to the borromean signature of
2368d846e671bf79a1f84c6d3af9f0bfe296f043f50cf17ae5e485384a53707b
This commit is contained in:
Boog900
2023-05-31 23:06:06 +01:00
parent 4a2f512b8d
commit 71ffcc8ef7
5 changed files with 19 additions and 17 deletions

View File

@@ -98,14 +98,14 @@ fn amount_decryption(amount: &EcdhInfo, key: Scalar) -> u64 {
EcdhInfo::Standard { mask, amount } => {
let shared_sec1 = hash(key.as_bytes());
let shared_sec2 = hash(&shared_sec1);
let mask_scalar = mask - Scalar::from_bytes_mod_order(shared_sec1);
let _mask_scalar = mask - Scalar::from_bytes_mod_order(shared_sec1);
let amount_scalar = amount - Scalar::from_bytes_mod_order(shared_sec2);
// get first 64 bits (d2b in rctTypes.cpp)
let amount_significant_bytes =
amount_scalar.to_bytes()[0 .. 8].try_into().expect("Can't fail");
let amount = u64::from_le_bytes(amount_significant_bytes);
amount
u64::from_le_bytes(amount_significant_bytes)
}
EcdhInfo::Bulletproof { amount } => {
u64::from_le_bytes(amount_encryption(u64::from_le_bytes(*amount), key))