diff --git a/src/air/public_input.cairo b/src/air/public_input.cairo index ca7de26ba..a7f98dfdc 100644 --- a/src/air/public_input.cairo +++ b/src/air/public_input.cairo @@ -205,6 +205,7 @@ fn verify_cairo1_public_input(public_input: @PublicInput) -> (felt252, felt252) #[cfg(test)] mod tests { + use core::debug::PrintTrait; use super::get_public_input_hash; use cairo_verifier::tests::stone_proof_fibonacci_keccak::public_input::get; // test data from cairo0-verifier run on stone-prover generated proof @@ -213,9 +214,9 @@ mod tests { fn test_get_public_input_hash() { let public_input = get(); let hash = get_public_input_hash(@public_input, 20); - assert( - hash == 0xaf91f2c71f4a594b1575d258ce82464475c82d8fb244142d0db450491c1b52, 'Hash invalid' + hash == 0x113b1d4f79ee0dac11d2677f9f6dc8ffacb6ea129f3ae1e45e1158ad500791f, + 'Hash invalid' ) } } diff --git a/src/common/hasher.cairo b/src/common/hasher.cairo index a90e3b883..4c2f4eed5 100644 --- a/src/common/hasher.cairo +++ b/src/common/hasher.cairo @@ -29,8 +29,8 @@ fn hash_n_bytes(mut data: Array, n: u8, hash_len: bool) -> u256 { } } fn hash_truncated(mut data: Array) -> felt252 { - (keccak::cairo_keccak(ref data, 0, 0) - .flip_endianness() & 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) + (keccak::cairo_keccak(ref data, 0, 0).flip_endianness() + & 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) .try_into() .unwrap() } diff --git a/src/common/tests/test_blake2s_u8.cairo b/src/common/tests/test_blake2s_u8.cairo index 972979778..feca4753d 100644 --- a/src/common/tests/test_blake2s_u8.cairo +++ b/src/common/tests/test_blake2s_u8.cairo @@ -1,6 +1,4 @@ -use cairo_verifier::common::{ - array_append::ArrayAppendTrait, blake2s_u8::{blake2s, load32} -}; +use cairo_verifier::common::{array_append::ArrayAppendTrait, blake2s_u8::{blake2s, load32}}; fn get_arr_v1(n: u32) -> Array { let mut arr = ArrayTrait::new(); @@ -88,4 +86,4 @@ fn test_blake2s_v2() { ) == 0x5229f5d506302edae36f9cac3f5d176cd9b6aa8420da6d74d7956789099faf70, 'invalid hash (2)' ); -} \ No newline at end of file +} diff --git a/src/stark.cairo b/src/stark.cairo index 7f26a08be..628173dc3 100644 --- a/src/stark.cairo +++ b/src/stark.cairo @@ -89,7 +89,9 @@ impl StarkProofImpl of StarkProofTrait { self.public_input.validate(@stark_domains); // Compute the initial hash seed for the Fiat-Shamir channel. - let digest = get_public_input_hash(self.public_input, *self.config.n_verifier_friendly_commitment_layers); + let digest = get_public_input_hash( + self.public_input, *self.config.n_verifier_friendly_commitment_layers + ); // Construct the channel. let mut channel = ChannelImpl::new(digest); diff --git a/src/stark/tests.cairo b/src/stark/tests.cairo index 5834fa134..b4a94bd75 100644 --- a/src/stark/tests.cairo +++ b/src/stark/tests.cairo @@ -1,6 +1,5 @@ // === RECURSIVE BEGIN === mod test_stark_commit; -mod test_stark_proof_verify; mod test_stark_verify; // === RECURSIVE END === diff --git a/src/stark/tests/test_stark_proof_verify.cairo b/src/stark/tests/test_stark_proof_verify.cairo deleted file mode 100644 index 03b492b63..000000000 --- a/src/stark/tests/test_stark_proof_verify.cairo +++ /dev/null @@ -1,40 +0,0 @@ -use cairo_verifier::{ - stark::{StarkProof, StarkProofTrait}, - tests::{stone_proof_fibonacci, stone_proof_fibonacci_keccak} -}; - -// === BLAKE2S BEGIN === -// #[test] -// #[available_gas(99999999999)] -// fn test_stark_proof_fibonacci_verify() { -// let security_bits: felt252 = 50; -// -// let stark_proof = StarkProof { -// config: stone_proof_fibonacci::stark::config::get(), -// public_input: stone_proof_fibonacci::public_input::get(), -// unsent_commitment: stone_proof_fibonacci::stark::unsent_commitment::get(), -// witness: stone_proof_fibonacci::stark::witness::get(), -// }; -// -// stark_proof.verify(security_bits); -// } -// === BLAKE2S END === - -// === KECCAK BEGIN === -#[test] -#[available_gas(9999999999)] -fn test_stark_proof_fibonacci_verify() { - let security_bits: felt252 = 50; - - let stark_proof = StarkProof { - config: stone_proof_fibonacci_keccak::stark::config::get(), - public_input: stone_proof_fibonacci_keccak::public_input::get(), - unsent_commitment: stone_proof_fibonacci_keccak::stark::unsent_commitment::get(), - witness: stone_proof_fibonacci_keccak::stark::witness::get(), - }; - - stark_proof.verify(security_bits); -} -// === KECCAK END === - -