/src/sqr/fp_sqrmod.c
http://github.com/libtom/tomsfastmath · C · 12 lines · 8 code · 1 blank · 3 comment · 0 complexity · 9107021fb4bf56df06b6e54e5835cae6 MD5 · raw file
- /* TomsFastMath, a fast ISO C bignum library. -- Tom St Denis */
- /* SPDX-License-Identifier: Unlicense */
- #include <tfm_private.h>
- /* c = a * a (mod b) */
- int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c)
- {
- fp_int tmp;
- fp_zero(&tmp);
- fp_sqr(a, &tmp);
- return fp_mod(&tmp, b, c);
- }