Skip to content

Commit

Permalink
chore: add safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Mar 20, 2024
1 parent 6d16cd5 commit c60d61f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions noir_stdlib/src/field/bn254.nr
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ pub fn gt(a: Field, b: Field) -> bool {
false
} else {
let a_lt_b = unsafe {
// Safety: We immediately assert the output to be valid based on the if-branch followed.
// Using `assert_gt` is sufficient as we've checked for equality already.
lt_unsafe(a, b, 32)
};
if a_lt_b {
Expand Down

0 comments on commit c60d61f

Please sign in to comment.