mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-14 23:19:24 +00:00
dalek 4.0
This commit is contained in:
@@ -83,7 +83,7 @@ impl SendOutput {
|
||||
SendOutput {
|
||||
R,
|
||||
view_tag,
|
||||
dest: ((&shared_key * &ED25519_BASEPOINT_TABLE) + output.0.spend),
|
||||
dest: ((&shared_key * ED25519_BASEPOINT_TABLE) + output.0.spend),
|
||||
commitment: Commitment::new(commitment_mask(shared_key), output.1),
|
||||
amount: amount_encryption(output.1, shared_key),
|
||||
},
|
||||
@@ -105,7 +105,7 @@ impl SendOutput {
|
||||
output,
|
||||
r.deref() * address.view,
|
||||
if !address.is_subaddress() {
|
||||
r.deref() * &ED25519_BASEPOINT_TABLE
|
||||
r.deref() * ED25519_BASEPOINT_TABLE
|
||||
} else {
|
||||
r.deref() * address.spend
|
||||
},
|
||||
@@ -577,7 +577,7 @@ impl SignableTransaction {
|
||||
|
||||
// Used for all non-subaddress outputs, or if there's only one subaddress output and a change
|
||||
let tx_key = Zeroizing::new(random_scalar(&mut rng));
|
||||
let mut tx_public_key = tx_key.deref() * &ED25519_BASEPOINT_TABLE;
|
||||
let mut tx_public_key = tx_key.deref() * ED25519_BASEPOINT_TABLE;
|
||||
|
||||
// If any of these outputs are to a subaddress, we need keys distinct to them
|
||||
// The only time this *does not* force having additional keys is when the only other output
|
||||
@@ -597,7 +597,7 @@ impl SignableTransaction {
|
||||
InternalPayment::Change(_, _) => {}
|
||||
}
|
||||
}
|
||||
debug_assert!(tx_public_key != (tx_key.deref() * &ED25519_BASEPOINT_TABLE));
|
||||
debug_assert!(tx_public_key != (tx_key.deref() * ED25519_BASEPOINT_TABLE));
|
||||
}
|
||||
|
||||
// Actually create the outputs
|
||||
@@ -810,7 +810,7 @@ impl SignableTransaction {
|
||||
let mut images = Vec::with_capacity(self.inputs.len());
|
||||
for (input, _) in &self.inputs {
|
||||
let mut offset = Zeroizing::new(spend.deref() + input.key_offset());
|
||||
if (offset.deref() * &ED25519_BASEPOINT_TABLE) != input.key() {
|
||||
if (offset.deref() * ED25519_BASEPOINT_TABLE) != input.key() {
|
||||
Err(TransactionError::WrongPrivateKey)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ impl SignMachine<Transaction> for TransactionSignMachine {
|
||||
sorted.sort_by(|x, y| key_image_sort(&x.0, &y.0));
|
||||
|
||||
let mut rng = ChaCha20Rng::from_seed(self.transcript.rng_seed(b"pseudo_out_masks"));
|
||||
let mut sum_pseudo_outs = Scalar::zero();
|
||||
let mut sum_pseudo_outs = Scalar::ZERO;
|
||||
while !sorted.is_empty() {
|
||||
let value = sorted.remove(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user