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
4 changes: 1 addition & 3 deletions spec/chapters/shift.typ
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ Hereafter, one must only check that `out` is the proper cast of `shifted` into a
#render_constraint_table(chip, config, groups: "limb_shifting")

== Miscellaneous
#render_constraint_table(chip, config, groups: ("left_flag", "is_negative"))
*Note*: `is_negative` is not used when `signed = 0`.
As such, there is no problem with it being unconstrained in this case.
#render_constraint_table(chip, config, groups: ("left_flag", "sign"))

== Lookups
This chip adds the following interaction to the lookup.
Expand Down
2 changes: 1 addition & 1 deletion spec/src/keccak_round.toml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ kind = "interaction"
tag = "KECCAK_RC"
input = ["round"]
output = "rc"
multiplicity = ["-", "μ"]
multiplicity = "μ"

[[constraint_groups]]
name = "theta"
Expand Down
20 changes: 9 additions & 11 deletions spec/src/shift.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ pad = 0
# Auxiliary

[[variables.auxiliary]]
name = "is_negative"
name = "sign"
type = "Bit"
desc = "Whether `in` is negative"
desc = "The sign bit of `in`"
pad = 0

[[variables.auxiliary]]
Expand Down Expand Up @@ -95,7 +95,7 @@ def = {idx = "i", polys = [
name = "extension"
type = "Half"
desc = "sign extension of `in`."
def = ["*", 65535, "is_negative"]
def = ["*", 65535, "sign"]

[[variables.virtual]]
name = "left"
Expand Down Expand Up @@ -204,15 +204,13 @@ ref = "shift:c:direction_implies_mu"


[[constraint_groups]]
name = "is_negative"
name = "sign"

[[constraints.is_negative]]
kind = "interaction"
tag = "MSB16"
input = [["idx", "in", 3]]
output = "is_negative"
multiplicity = "signed"
ref = "shift:c:is_negative_if_signed"
[[constraints.sign]]
kind = "template"
tag = "SIGN"
input = [["idx", "in", 3], "signed"]
output = "sign"


[[constraint_groups]]
Expand Down
Loading