]> pd.if.org Git - zpackage/blob - crypto/ref10/fe_add.c
remove stray debug fprintf
[zpackage] / crypto / ref10 / fe_add.c
1 #define _POSIX_C_SOURCE 200109L
2
3 #include <stdint.h>
4
5 /*
6 h = f + g
7 Can overlap h with f or g.
8
9 Preconditions:
10    |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
11    |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
12
13 Postconditions:
14    |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
15 */
16
17 void fe_add(int32_t h[10], int32_t f[10], int32_t g[10]) {
18         int32_t f0 = f[0];
19         int32_t f1 = f[1];
20         int32_t f2 = f[2];
21         int32_t f3 = f[3];
22         int32_t f4 = f[4];
23         int32_t f5 = f[5];
24         int32_t f6 = f[6];
25         int32_t f7 = f[7];
26         int32_t f8 = f[8];
27         int32_t f9 = f[9];
28         int32_t g0 = g[0];
29         int32_t g1 = g[1];
30         int32_t g2 = g[2];
31         int32_t g3 = g[3];
32         int32_t g4 = g[4];
33         int32_t g5 = g[5];
34         int32_t g6 = g[6];
35         int32_t g7 = g[7];
36         int32_t g8 = g[8];
37         int32_t g9 = g[9];
38         int32_t h0 = f0 + g0;
39         int32_t h1 = f1 + g1;
40         int32_t h2 = f2 + g2;
41         int32_t h3 = f3 + g3;
42         int32_t h4 = f4 + g4;
43         int32_t h5 = f5 + g5;
44         int32_t h6 = f6 + g6;
45         int32_t h7 = f7 + g7;
46         int32_t h8 = f8 + g8;
47         int32_t h9 = f9 + g9;
48         h[0] = h0;
49         h[1] = h1;
50         h[2] = h2;
51         h[3] = h3;
52         h[4] = h4;
53         h[5] = h5;
54         h[6] = h6;
55         h[7] = h7;
56         h[8] = h8;
57         h[9] = h9;
58 }