diff --git a/garble/mpz-garble-core/src/evaluator.rs b/garble/mpz-garble-core/src/evaluator.rs index 18ffca03..5f28b0b9 100644 --- a/garble/mpz-garble-core/src/evaluator.rs +++ b/garble/mpz-garble-core/src/evaluator.rs @@ -44,7 +44,7 @@ pub(crate) fn and_gate( let k = Block::new(((gid + 1) as u128).to_be_bytes()); let mut h = [x, y]; - cipher.tccr_many_inplace(&[j, k], &mut h); + cipher.tccr_many(&[j, k], &mut h); let [hx, hy] = h; diff --git a/garble/mpz-garble-core/src/generator.rs b/garble/mpz-garble-core/src/generator.rs index a7e73d86..37e0cdec 100644 --- a/garble/mpz-garble-core/src/generator.rs +++ b/garble/mpz-garble-core/src/generator.rs @@ -46,7 +46,7 @@ pub(crate) fn and_gate( let k = Block::new(((gid + 1) as u128).to_be_bytes()); let mut h = [x_0, y_0, x_1, y_1]; - cipher.tccr_many_inplace(&[j, k, j, k], &mut h); + cipher.tccr_many(&[j, k, j, k], &mut h); let [hx_0, hy_0, hx_1, hy_1] = h; diff --git a/mpz-core/src/aes.rs b/mpz-core/src/aes.rs index b270c335..7623f6c7 100644 --- a/mpz-core/src/aes.rs +++ b/mpz-core/src/aes.rs @@ -51,7 +51,7 @@ impl FixedKeyAes { /// * `tweaks` - The tweaks to use for each block in `blocks`. /// * `blocks` - The blocks to hash in-place. #[inline] - pub fn tccr_many_inplace(&self, tweaks: &[Block; N], blocks: &mut [Block; N]) { + pub fn tccr_many(&self, tweaks: &[Block; N], blocks: &mut [Block; N]) { // Store π(x) in `blocks` self.aes .encrypt_blocks(Block::as_generic_array_mut_slice(blocks)); @@ -90,7 +90,7 @@ impl FixedKeyAes { /// /// * `blocks` - The blocks to hash in-place. #[inline] - pub fn cr_many_inplace(&self, blocks: &mut [Block; N]) { + pub fn cr_many(&self, blocks: &mut [Block; N]) { let mut buf = *blocks; self.aes @@ -124,9 +124,9 @@ impl FixedKeyAes { /// /// * `blocks` - The blocks to hash in-place. #[inline] - pub fn ccr_many_inplace(&self, blocks: &mut [Block; N]) { + pub fn ccr_many(&self, blocks: &mut [Block; N]) { blocks.iter_mut().for_each(|b| *b = Block::sigma(*b)); - self.cr_many_inplace(blocks); + self.cr_many(blocks); } } @@ -160,9 +160,9 @@ impl AesEncryptor { blks } - /// Encrypt many blocks in-place. + /// Encrypt slice of blocks in-place. #[inline] - pub fn encrypt_many_blocks_inplace(&self, blks: &mut [Block]) { + pub fn encrypt_blocks(&self, blks: &mut [Block]) { self.0 .encrypt_blocks(Block::as_generic_array_mut_slice(blks)); } @@ -188,7 +188,7 @@ impl AesEncryptor { keys.iter() .zip(blks.chunks_exact_mut(NM)) .for_each(|(key, blks)| { - key.encrypt_many_blocks_inplace(blks); + key.encrypt_blocks(blks); }); } }