18 #define SC_LIMB_BITS 52
20 #define SC_LIMB_MASK ((1L << SC_LIMB_BITS)-1)
24 #define SC_LIMB_NUM 10
25 #define SC_LIMB_BITS 26
27 #define SC_LIMB_MASK ((1 << SC_LIMB_BITS)-1)
32 #define SC_BITS (SC_LIMB_NUM * SC_LIMB_BITS)
35 /* sc_t holds 260bit in reduced form */
36 typedef limb_t sc_t[SC_LIMB_NUM];
38 /* lsc_t is double in size and holds up to 520bits in reduced form */
39 typedef limb_t lsc_t [2*SC_LIMB_NUM];
43 extern const sc_t con_off;
46 void sc_reduce(sc_t dst, const lsc_t src);
47 void sc_import(sc_t dst, const uint8_t *src, size_t len);
48 void sc_export(uint8_t dst[32], const sc_t x);
49 void sc_mul(sc_t res, const sc_t a, const sc_t b);
50 int sc_jsf(int u0[SC_BITS+1], int u1[SC_BITS+1], const sc_t a, const sc_t b);
54 sc_add(sc_t res, const sc_t a, const sc_t b)
57 for (i = 0; i < SC_LIMB_NUM; i++)