Skip to content

Audit preparedness: test binary operations #5426

@michaeljklein

Description

@michaeljklein

Problem

Part of #5362

// "kind" in binary::Binary (op)
pub(crate) enum BinaryOp {
  • Sanity-check that behavior of these match for example inputs 0..8 (or are None): get_field_function, get_u128_function, get_i128_function

Magmas:

  • Test associativity
  • Test (anti-)commutativity (add_sub and sub_add tests implicitly do so)
  • Test identity
  • Add
  • Sub
  • Mul
  • Div
  • Mod
  • And
  • Or
  • Xor
  • Shl
  • Shr

Comparisons:

  • Test (anti-)reflexivity
  • Test transitivity
  • Test (anti-)commutativity
  • Eq
  • Lt
pub enum BlackBoxFunc {
  • AND
  • XOR
  • EmbeddedCurveAdd
  • BigIntAdd
  • BigIntSub
  • BigIntMul
  • BigIntDiv

Happy Case

Test all listed binary operations

Project Impact

None

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions