From 23a902e1e01dd2ad4cc385693795727b063b21f7 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Thu, 16 Dec 2021 15:58:38 +0100 Subject: [PATCH] Fix nits --- src/plonk/config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plonk/config.rs b/src/plonk/config.rs index c628bc38..e448bc7c 100644 --- a/src/plonk/config.rs +++ b/src/plonk/config.rs @@ -156,7 +156,7 @@ impl AlgebraicHasher for PoseidonHash { // } // } -/// Keccak hash function. +/// Keccak-256 hash function. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct KeccakHash; impl Hasher for KeccakHash { @@ -167,7 +167,8 @@ impl Hasher for KeccakHash { let mut buffer = Buffer::new(Vec::new()); buffer.write_field_vec(&input).unwrap(); let mut arr = [0; N]; - arr.copy_from_slice(&keccak(buffer.bytes()).0[..N]); + let hash_bytes = keccak(buffer.bytes()).0; + arr.copy_from_slice(&hash_bytes[..N]); BytesHash(arr) } @@ -187,7 +188,7 @@ pub trait GenericConfig: { /// Main field. type F: RichField + Extendable; - /// Field extension of degree 4 of the main field. + /// Field extension of degree D of the main field. type FE: FieldExtension; /// Hash function used for building Merkle trees. type Hasher: Hasher;