Skip to content

Commit 5a3689b

Browse files
committed
Remove unnecessary weak spec for mld_montgomery_reduce()
mld_montgomery_reduce() so far had two CBMC specs with varying input/output bounds. However, it appears that the weak version is not necessary and can be removed. Signed-off-by: Hanno Becker <[email protected]>
1 parent 4e59b6f commit 5a3689b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mldsa/reduce.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@
4848
**************************************************/
4949
int32_t mld_montgomery_reduce(int64_t a)
5050
__contract__(
51-
requires(a >= -MONTGOMERY_REDUCE_DOMAIN_MAX && a <= MONTGOMERY_REDUCE_DOMAIN_MAX)
52-
ensures(return_value >= INT32_MIN && return_value < REDUCE32_DOMAIN_MAX)
53-
54-
/* Special case - for stronger input bounds, we can ensure stronger bounds on the output */
55-
ensures((a >= -MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX && a < MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX) ==>
56-
(return_value > -MLDSA_Q && return_value < MLDSA_Q))
51+
requires(a >= -MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX && a < MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX)
52+
ensures(return_value > -MLDSA_Q && return_value < MLDSA_Q)
5753
);
5854

5955
#define mld_reduce32 MLD_NAMESPACE(reduce32)

0 commit comments

Comments
 (0)