Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions circuits/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use dep::keccak::padding as padding;

use dep::keccak::constants as constants;
use dep::keccak::padding::pad;
use dep::keccak::constants;

// This is a simplified implementation of the Keccak256 hash function.
// In particular we assume that the `input_length` will be less than the size of the absorb step's block size.
fn main(input: [u1; constants::INPUT_SIZE], input_length: u64) -> pub [u1; constants::BLOCK_SIZE] {
padding::pad(input, input_length)
pad(input, input_length)
}
2 changes: 1 addition & 1 deletion lib/src/padding.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants as constants;
use crate::constants;

// This is a simplified implementation of the pad10*1 algorithm.
// As we assume that the input length is smaller than the block size, we can ignore the potential for the padding
Expand Down
2 changes: 1 addition & 1 deletion lib/src/permutations/chi.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants as constants;
use crate::constants;

fn chi(state: [u1; constants::STATE_SIZE]) -> [u1; constants::STATE_SIZE] {
// The labelling convention for the state array is `state[x, y, z] = state[LANE_LENGTH * (5y + x) + z]`.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/permutations/iota.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants as constants;
use crate::constants;

fn iota(state: [u1; constants::STATE_SIZE], round_number: comptime Field) -> [u1; constants::STATE_SIZE] {
// Each element of RC is a bitmap for the mask to apply to the lane.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/permutations/rhoPi.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants as constants;
use crate::constants;

// This function is a combination of the rho and pi functions as defined in the Keccak256 specification.
// We merge these two functions as rho consists of a rotation of the bits within each lane and pi is a remapping of
Expand Down
2 changes: 1 addition & 1 deletion lib/src/permutations/theta.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants as constants;
use crate::constants;

fn theta(state: [u1; constants::STATE_SIZE]) -> [u1; constants::STATE_SIZE] {
// The theta function works by calculating the parity of each of the columns in the state array. We store these
Expand Down
4 changes: 2 additions & 2 deletions test/test-circuits/padding/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::keccak::padding::pad as pad;
use dep::keccak::constants as constants;
use dep::keccak::padding::pad;
use dep::keccak::constants;

fn main(input: [u1; constants::INPUT_SIZE], input_length: u64) -> pub [u1; constants::BLOCK_SIZE] {
pad(input, input_length)
Expand Down