Skip to content

Commit

Permalink
Merge branch 'main' into tests_robust
Browse files Browse the repository at this point in the history
  • Loading branch information
richajaindce committed Oct 6, 2023
2 parents 1d5cace + 14a6b77 commit e4a2bb2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 59 deletions.
5 changes: 3 additions & 2 deletions ipa-macros/src/derive_step/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ fn get_meta_data_for(
ident,
"ipa_macros::step expects an enum with variants that match the steps in \
steps.txt. If you've made a change to steps, make sure to run `collect_steps.py` \
and replace steps.txt with the output. If the step is not a part of the protocol, \
consider removing it.",
and replace steps.txt with the output. If the step is not a part of the protocol \
yet, you can temporarily hide the step or the module containing the step with \
`#[cfg(feature = \"descriptive-gate\")]`.",
))
}
1 => {
Expand Down
33 changes: 0 additions & 33 deletions scripts/collect_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,7 @@
DEPTH_DYNAMIC_STEPS = [
"ipa::protocol::attribution::InteractionPatternStep",
]
# Same here. There are steps that are executed depending on the number of bits in the
# used field.
BIT_DYNAMIC_STEPS = [
"ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks",
"ipa::protocol::attribution::aggregate_credit::Step::check_times_credit",
]
# another one for modulus conversion
MODULUS_CONVERSION_DYNAMIC_STEPS = [
"ipa::protocol::sort::SortStep::convert",
"ipa::protocol::attribution::AttributionStep::convert_helper_bits",
"ipa::protocol::boolean::solved_bits::Step::random_bits",
"ipa::protocol::attribution::aggregate_credit::Step::mod_conv_breakdown_key_bits",
]
MAXIMUM_DEPTH = 32
MAXIMUM_BIT_LENGTH = 32
MAXIMUM_CONVERT_BIT_LENGTH = 64


def set_env():
Expand All @@ -82,8 +67,6 @@ def remove_root_step_name_from_line(l):
def collect_steps(args):
output = set()
depth_dynamic_steps = set()
bit_dynamic_steps = set()
modulus_conversion_dynamic_steps = set()

proc = subprocess.Popen(
args=args,
Expand Down Expand Up @@ -111,14 +94,6 @@ def collect_steps(args):
depth_dynamic_steps.add(remove_root_step_name_from_line(line))
# continue without adding to the `output`. we'll generate the dynamic steps later
continue
if any(s in line for s in BIT_DYNAMIC_STEPS):
line = re.sub(r"bit\d+", "bitX", line)
bit_dynamic_steps.add(remove_root_step_name_from_line(line))
continue
if any(s in line for s in MODULUS_CONVERSION_DYNAMIC_STEPS):
line = re.sub(r"mc\d+", "mcX", line)
modulus_conversion_dynamic_steps.add(remove_root_step_name_from_line(line))
continue

output.update([remove_root_step_name_from_line(line)])

Expand All @@ -132,14 +107,6 @@ def collect_steps(args):
for s in depth_dynamic_steps:
line = re.sub(r"depthX", "depth" + str(i), s)
output.add(line)
for i in range(MAXIMUM_BIT_LENGTH):
for s in bit_dynamic_steps:
line = re.sub(r"bitX", "bit" + str(i), s)
output.add(line)
for i in range(MAXIMUM_CONVERT_BIT_LENGTH):
for s in modulus_conversion_dynamic_steps:
line = re.sub(r"mcX", "mc" + str(i), s)
output.add(line)

return output

Expand Down
24 changes: 0 additions & 24 deletions src/protocol/step/steps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1607,14 +1607,11 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::agg
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::check_times_credit/ipa::protocol::step::BitOpStep::bit8
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::check_times_credit/ipa::protocol::step::BitOpStep::bit9
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit0
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit1
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit10
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit11
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit12
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit13
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit14
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit15
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit16
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit17
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit18
Expand All @@ -1630,13 +1627,10 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::agg
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit27
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit28
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit29
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit3
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit30
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit31
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit4
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit5
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit6
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit7
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit8
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit9
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::attribution::aggregate_credit::Step::mod_conv_breakdown_key_bits
Expand Down Expand Up @@ -5273,12 +5267,6 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validat
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::check_times_credit/ipa::protocol::step::BitOpStep::bit9/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::check_times_credit/ipa::protocol::step::BitOpStep::bit9/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit0
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit0/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit0/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit1
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit1/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit1/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit10
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit10/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit10/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
Expand All @@ -5294,9 +5282,6 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validat
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit14
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit14/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit14/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit15
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit15/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit15/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit16
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit16/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit16/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
Expand Down Expand Up @@ -5342,15 +5327,9 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validat
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit29
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit29/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit29/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit3
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit3/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit3/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit30
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit30/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit30/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit31
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit31/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit31/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit4
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit4/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit4/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
Expand All @@ -5360,9 +5339,6 @@ ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validat
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit6
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit6/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit6/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit7
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit7/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit7/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit8
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit8/ipa::protocol::basics::mul::malicious::Step::duplicate_multiply
ipa::protocol::ipa::Step::after_convert_all_bits/ipa::protocol::context::validator::Step::malicious_protocol/ipa::protocol::attribution::aggregate_credit::Step::compute_equality_checks/ipa::protocol::step::BitOpStep::bit8/ipa::protocol::basics::mul::malicious::Step::randomness_for_validation
Expand Down

0 comments on commit e4a2bb2

Please sign in to comment.