diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo index 187cec869..138938343 100644 --- a/src/channel/channel.cairo +++ b/src/channel/channel.cairo @@ -21,7 +21,7 @@ impl ChannelImpl of ChannelTrait { } fn random_uint256_to_prover(ref self: Channel) -> u256 { - let mut hash_data = ArrayTrait::::new(); + let mut hash_data = ArrayTrait::::new(); hash_data.append_big_endian(self.digest); hash_data.append_big_endian(self.counter); self.counter += 1; @@ -60,7 +60,7 @@ impl ChannelImpl of ChannelTrait { } fn read_felt_from_prover(ref self: Channel, value: felt252) { - let mut hash_data = ArrayTrait::::new(); + let mut hash_data = ArrayTrait::::new(); assert(self.digest.low != BoundedU128::max(), 'digest low is 2^128-1'); hash_data.append_big_endian(self.digest + 1); @@ -76,7 +76,7 @@ impl ChannelImpl of ChannelTrait { } fn read_felt_vector_from_prover(ref self: Channel, values: Span) { - let mut hash_data = ArrayTrait::::new(); + let mut hash_data = ArrayTrait::::new(); assert(self.digest.low != BoundedU128::max(), 'digest low is 2^128-1'); hash_data.append_big_endian(self.digest + 1); @@ -95,15 +95,14 @@ impl ChannelImpl of ChannelTrait { } fn read_uint64_from_prover(ref self: Channel, value: u64) { - let mut hash_data = ArrayTrait::::new(); + let mut hash_data = ArrayTrait::::new(); assert(self.digest.low != BoundedU128::max(), 'digest low is 2^128-1'); hash_data.append_big_endian(self.digest + 1); let low: u32 = (value % 0x100000000).try_into().unwrap(); let high: u32 = (value / 0x100000000).try_into().unwrap(); - hash_data.append(high.flip_endianness()); - hash_data.append(low.flip_endianness()); + hash_data.append_big_endian(value); self.digest = blake2s(hash_data).flip_endianness(); self.counter = 0;