Skip to content

Commit

Permalink
Use BoundedU128::max()
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Dec 22, 2023
1 parent 63171e1 commit 36e32ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/channel/channel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use cairo_verifier::common::{
flip_endiannes::FlipEndiannessTrait, to_array::ToArrayTrait, blake2s::blake2s
};
use poseidon::poseidon_hash_span;
use core::integer::BoundedU128;

const C_PRIME_AS_UINT256_LOW: u128 = 31;
const C_PRIME_AS_UINT256_HIGH: u128 =
Expand Down Expand Up @@ -59,7 +60,7 @@ impl ChannelImpl of ChannelTrait {
let value_u256: u256 = value.into();
let mut hash_data = ArrayTrait::<u32>::new();

assert(self.digest.low != 0xffffffffffffffffffffffffffffffff, 'digest low is 2^128-1');
assert(self.digest.low != BoundedU128::max(), 'digest low is 2^128-1');
(self.digest + 1).to_array_be(ref hash_data);
value_u256.to_array_be(ref hash_data);

Expand Down

0 comments on commit 36e32ad

Please sign in to comment.