Lint previous commit

This commit is contained in:
Luke Parker
2022-08-22 13:35:49 -04:00
parent 5c106cecf6
commit 5b2940e161
6 changed files with 40 additions and 22 deletions

View File

@@ -129,8 +129,8 @@ async fn prepare_inputs<R: RngCore + CryptoRng>(
for (i, input) in inputs.iter().enumerate() {
signable.push((
spend + input.output.data.key_offset,
generate_key_image(spend + input.output.data.key_offset),
spend + input.key_offset(),
generate_key_image(spend + input.key_offset()),
ClsagInput::new(input.commitment().clone(), decoys[i].clone())
.map_err(TransactionError::ClsagError)?,
));
@@ -345,8 +345,8 @@ impl SignableTransaction {
) -> Result<Transaction, TransactionError> {
let mut images = Vec::with_capacity(self.inputs.len());
for input in &self.inputs {
let mut offset = spend + input.output.data.key_offset;
if (&offset * &ED25519_BASEPOINT_TABLE) != input.output.data.key {
let mut offset = spend + input.key_offset();
if (&offset * &ED25519_BASEPOINT_TABLE) != input.key() {
Err(TransactionError::WrongPrivateKey)?;
}

View File

@@ -104,7 +104,7 @@ impl SignableTransaction {
transcript.append_message(b"input_output_index", &[input.output.absolute.o]);
// Not including this, with a doxxed list of payments, would allow brute forcing the inputs
// to determine RNG seeds and therefore the true spends
transcript.append_message(b"input_shared_key", &input.output.data.key_offset.to_bytes());
transcript.append_message(b"input_shared_key", &input.key_offset().to_bytes());
}
for payment in &self.payments {
transcript.append_message(b"payment_address", payment.0.to_string().as_bytes());
@@ -116,14 +116,14 @@ impl SignableTransaction {
for (i, input) in self.inputs.iter().enumerate() {
// Check this the right set of keys
let offset = keys.offset(dalek_ff_group::Scalar(input.output.data.key_offset));
if offset.group_key().0 != input.output.data.key {
let offset = keys.offset(dalek_ff_group::Scalar(input.key_offset()));
if offset.group_key().0 != input.key() {
Err(TransactionError::WrongPrivateKey)?;
}
clsags.push(
AlgorithmMachine::new(
ClsagMultisig::new(transcript.clone(), input.output.data.key, inputs[i].clone())
ClsagMultisig::new(transcript.clone(), input.key(), inputs[i].clone())
.map_err(TransactionError::MultisigError)?,
offset,
&included,