Skip to content

Commit

Permalink
Modular exponentiation with exponent 0 is allowed in BOLOS
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspider committed Dec 10, 2024
1 parent fde57e3 commit 0a2a301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bolos/cx_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ cx_err_t cx_mpi_mod_pow(cx_mpi_t *r, const cx_mpi_t *a, const cx_mpi_t *e,
cx_err_t error;

// N must be odd
if ((cx_mpi_is_odd(n)) == 0 || cx_mpi_is_zero(e)) {
if (cx_mpi_is_odd(n) == 0) {
error = CX_INVALID_PARAMETER;
} else if (BN_mod_exp(r, a, e, n, local_bn_ctx) == 0) {
error = CX_INTERNAL_ERROR;
Expand Down

0 comments on commit 0a2a301

Please sign in to comment.