cargo fmt 1.31.1

This commit is contained in:
Jack Grigg
2019-01-03 21:52:06 +00:00
parent e378229bdd
commit 1a1c77536d
4 changed files with 25 additions and 21 deletions

View File

@@ -149,8 +149,7 @@ fn expand_array(vin: &[u8], bit_len: usize, byte_pad: usize) -> Vec<u8> {
vout[j + x] = ((
// Big-endian
acc_value >> (acc_bits + (8 * (out_width - x - 1)))
)
& (
) & (
// Apply bit_len_mask across byte boundaries
(bit_len_mask >> (8 * (out_width - x - 1))) & 0xFF
)) as u8;

View File

@@ -324,9 +324,10 @@ pub extern "system" fn librustzcash_merkle_hash(
.take(Fr::NUM_BITS as usize)
.chain(rhs.iter().map(|&x| x).take(Fr::NUM_BITS as usize)),
&JUBJUB,
).into_xy()
.0
.into_repr();
)
.into_xy()
.0
.into_repr();
// Should be okay, caller is responsible for ensuring the pointer
// is a valid pointer to 32 bytes that can be mutated.
@@ -914,7 +915,8 @@ pub extern "system" fn librustzcash_sprout_prove(
unsafe { &SPROUT_GROTH16_PARAMS_PATH }
.as_ref()
.expect("parameters should have been initialized"),
).expect("couldn't load Sprout groth16 parameters file");
)
.expect("couldn't load Sprout groth16 parameters file");
let mut sprout_fs = BufReader::with_capacity(1024 * 1024, sprout_fs);
@@ -1077,8 +1079,7 @@ pub extern "system" fn librustzcash_sapling_spend_sig(
// Compute the signature's message for rk/spend_auth_sig
let mut data_to_be_signed = [0u8; 64];
rk.0
.write(&mut data_to_be_signed[0..32])
rk.0.write(&mut data_to_be_signed[0..32])
.expect("message buffer should be 32 bytes");
(&mut data_to_be_signed[32..64]).copy_from_slice(&(unsafe { &*sighash })[..]);
@@ -1198,7 +1199,8 @@ pub extern "system" fn librustzcash_sapling_spend_proof(
unsafe { SAPLING_SPEND_PARAMS.as_ref() }.unwrap(),
unsafe { SAPLING_SPEND_VK.as_ref() }.unwrap(),
&JUBJUB,
).expect("proving should not fail");
)
.expect("proving should not fail");
// Write value commitment to caller
value_commitment