Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 0xPolygonMiden/air-script
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf22093d07c7042c903ef990fefb5260a572b237
Choose a base ref
..
head repository: 0xPolygonMiden/air-script
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: be073ac8a2bbfbb6834ac5e1a6d6c989903535ac
Choose a head ref
Showing with 5 additions and 8 deletions.
  1. +5 −8 constraints/miden-vm/bitwise.air
13 changes: 5 additions & 8 deletions constraints/miden-vm/bitwise.air
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@ ev check_binary(main: [a]):

# Returns value aggregated from limbs
fn aggregate(limb: vector[4]) -> scalar:
let result = sum([2^i * a for (i, a) in (0..4, limb)])
result
return sum([2^i * a for (i, a) in (0..4, limb)])


public_inputs:
@@ -32,18 +31,16 @@ integrity_constraints:
enf s' = s when k1

# Enforce that the input is decomposed into valid bits
enf check_binary([a_limb[i]]) for i in 0..4
enf check_binary([b_limb[i]]) for i in 0..4
enf check_binary([a]) for a in a_limb
enf check_binary([b]) for b in b_limb

# Enforce that the value in the first row of column `a` of the current 8-row cycle should be
# the aggregation of the decomposed bit columns `a_limb`.
let a_aggr = aggregate([a_limb])
enf a = a_aggr when k0
enf a = aggregate([a_limb]) when k0

# Enforce that the value in the first row of column `b` of the current 8-row cycle should be
# the aggregation of the decomposed bit columns `b_limb`.
let b_aggr = aggregate([b_limb])
enf b = b_aggr when k0
enf b = aggregate([b_limb]) when k0

# Enforce that for all rows in an 8-row cycle, except for the last one, the values in a and b
# columns are increased by the values contained in the individual bit columns a_limb and