54 WARN_UNUSED_RESULT cx_err_t cx_math_cmp_no_throw(
const uint8_t *a,
63 DEPRECATED
static inline int32_t cx_math_cmp(
const uint8_t *a,
const uint8_t *b,
size_t length)
66 CX_THROW(cx_math_cmp_no_throw(a, b, length, &diff));
89 WARN_UNUSED_RESULT cx_err_t cx_math_add_no_throw(
uint8_t *r,
121 cx_err_t error = cx_math_add_no_throw(r, a, b, len);
122 if (error && error != CX_CARRY) {
125 return (error == CX_CARRY);
147 WARN_UNUSED_RESULT cx_err_t cx_math_sub_no_throw(
uint8_t *r,
179 cx_err_t error = cx_math_sub_no_throw(r, a, b, len);
180 if (error && error != CX_CARRY) {
183 return (error == CX_CARRY);
205 WARN_UNUSED_RESULT cx_err_t cx_math_mult_no_throw(
uint8_t *r,
214 DEPRECATED
static inline void cx_math_mult(
uint8_t *r,
219 CX_THROW(cx_math_mult_no_throw(r, a, b, len));
246 WARN_UNUSED_RESULT cx_err_t
253 DEPRECATED
static inline void cx_math_addm(
uint8_t *r,
259 CX_THROW(cx_math_addm_no_throw(r, a, b, m, len));
286 WARN_UNUSED_RESULT cx_err_t
293 DEPRECATED
static inline void cx_math_subm(
uint8_t *r,
299 CX_THROW(cx_math_subm_no_throw(r, a, b, m, len));
326 WARN_UNUSED_RESULT cx_err_t cx_math_multm_no_throw(
uint8_t *r,
336 DEPRECATED
static inline void cx_math_multm(
uint8_t *r,
342 CX_THROW(cx_math_multm_no_throw(r, a, b, m, len));
366 WARN_UNUSED_RESULT cx_err_t cx_math_modm_no_throw(
uint8_t *v,
375 DEPRECATED
static inline void cx_math_modm(
uint8_t *v,
size_t len_v,
const uint8_t *m,
size_t len_m)
377 CX_THROW(cx_math_modm_no_throw(v, len_v, m, len_m));
405 WARN_UNUSED_RESULT cx_err_t cx_math_powm_no_throw(
uint8_t *r,
416 DEPRECATED
static inline void cx_math_powm(
uint8_t *r,
423 CX_THROW(cx_math_powm_no_throw(r, a, e, len_e, m, len));
447 WARN_UNUSED_RESULT cx_err_t cx_math_invprimem_no_throw(
uint8_t *r,
456 DEPRECATED
static inline void cx_math_invprimem(
uint8_t *r,
461 CX_THROW(cx_math_invprimem_no_throw(r, a, m, len));
486 WARN_UNUSED_RESULT cx_err_t cx_math_invintm_no_throw(
uint8_t *r,
495 DEPRECATED
static inline void cx_math_invintm(
uint8_t *r, uint32_t a,
const uint8_t *m,
size_t len)
497 CX_THROW(cx_math_invintm_no_throw(r, a, m, len));
519 WARN_UNUSED_RESULT cx_err_t cx_math_is_prime_no_throw(
const uint8_t *r,
size_t len,
bool *prime);
525 DEPRECATED
static inline bool cx_math_is_prime(
const uint8_t *r,
size_t len)
528 CX_THROW(cx_math_is_prime_no_throw(r, len, &prime));
549 WARN_UNUSED_RESULT cx_err_t cx_math_next_prime_no_throw(
uint8_t *r, uint32_t len);
555 DEPRECATED
static inline void cx_math_next_prime(
uint8_t *r, uint32_t len)
557 CX_THROW(cx_math_next_prime_no_throw(r, len));
569 static inline bool cx_math_is_zero(
const uint8_t *a,
size_t len)
572 for (i = 0; i < len; i++) {