mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 05:59:23 +00:00
fix for the jokester that added unreduced scalars
to the borromean signature of 2368d846e671bf79a1f84c6d3af9f0bfe296f043f50cf17ae5e485384a53707b
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user