Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef _MP_GF2M_H_ |
michael@0 | 6 | #define _MP_GF2M_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include "mpi.h" |
michael@0 | 9 | |
michael@0 | 10 | mp_err mp_badd(const mp_int *a, const mp_int *b, mp_int *c); |
michael@0 | 11 | mp_err mp_bmul(const mp_int *a, const mp_int *b, mp_int *c); |
michael@0 | 12 | |
michael@0 | 13 | /* For modular arithmetic, the irreducible polynomial f(t) is represented |
michael@0 | 14 | * as an array of int[], where f(t) is of the form: |
michael@0 | 15 | * f(t) = t^p[0] + t^p[1] + ... + t^p[k] |
michael@0 | 16 | * where m = p[0] > p[1] > ... > p[k] = 0. |
michael@0 | 17 | */ |
michael@0 | 18 | mp_err mp_bmod(const mp_int *a, const unsigned int p[], mp_int *r); |
michael@0 | 19 | mp_err mp_bmulmod(const mp_int *a, const mp_int *b, const unsigned int p[], |
michael@0 | 20 | mp_int *r); |
michael@0 | 21 | mp_err mp_bsqrmod(const mp_int *a, const unsigned int p[], mp_int *r); |
michael@0 | 22 | mp_err mp_bdivmod(const mp_int *y, const mp_int *x, const mp_int *pp, |
michael@0 | 23 | const unsigned int p[], mp_int *r); |
michael@0 | 24 | |
michael@0 | 25 | int mp_bpoly2arr(const mp_int *a, unsigned int p[], int max); |
michael@0 | 26 | mp_err mp_barr2poly(const unsigned int p[], mp_int *a); |
michael@0 | 27 | |
michael@0 | 28 | #endif /* _MP_GF2M_H_ */ |