Lines Matching defs:cc_unit

21 typedef uint64_t cc_unit;          // 64 bit unit
26 typedef uint32_t cc_unit; // 32 bit unit
31 typedef uint16_t cc_unit; // 16 bit unit
36 typedef uint8_t cc_unit; // 8 bit unit
45 typedef cc_unit *ccn_t; // n unit long mp
46 typedef cc_unit *ccnp1_t; // n + 1 unit long mp
47 typedef cc_unit *cc2n_t; // 2 * n unit long mp
48 typedef cc_unit *cc2np2_t; // 2 * n + 2 unit long mp
49 typedef const cc_unit *ccn_in_t; // n unit long mp
50 typedef const cc_unit *ccnp1_in_t; // n + 1 unit long mp
51 typedef const cc_unit *cc2n_in_t; // 2 * n unit long mp
52 typedef const cc_unit *cc2np2_in_t; // 2 * n + 2 unit long mp
54 #define CCN_UNIT_BITS (sizeof(cc_unit) * 8)
55 #define CCN_UNIT_MASK ((cc_unit)~0)
61 #define ccn_sizeof_n(_n_) (sizeof(cc_unit) * (_n_))
156 #define ccn64_32(a1,a0) (((cc_unit)a1) << 32 | ((cc_unit)a0))
260 cc_unit cc_clz(cc_unit data)
266 cc_unit cc_clz(cc_unit data)
278 cc_size ccn_n(cc_size n, const cc_unit *s) {
294 cc_unit a[2] = { s[n - 1], s[n - 2] };
302 cc_unit a[4] = { s[n - 1], s[n - 2], s[n - 3], s[n - 4] };
319 cc_size ccn_n(cc_size n, const cc_unit *s);
323 { N bit, scalar -> N bit } N = n * sizeof(cc_unit) * 8
327 cc_unit ccn_shift_right(cc_size n, cc_unit *r, const cc_unit *s, size_t k);
329 void ccn_shift_right_multi(cc_size n, cc_unit *r,const cc_unit *s, size_t k);
332 { N bit, scalar -> N bit } N = n * sizeof(cc_unit) * 8
336 cc_unit ccn_shift_left(cc_size n, cc_unit *r, const cc_unit *s, size_t k);
338 void ccn_shift_left_multi(cc_size n, cc_unit *r, const cc_unit *s, size_t k);
342 { N bit } N = n * sizeof(cc_unit) * 8 */
344 size_t ccn_bitlen(cc_size n, const cc_unit *s);
348 size_t ccn_trailing_zeros(cc_size n, const cc_unit *s);
351 { N bit } N = n * sizeof(cc_unit) * 8 */
355 { N bit } N = n * sizeof(cc_unit) * 8 */
360 int ccn_cmp(cc_size n, const cc_unit *s, const cc_unit *t) {
363 cc_unit si = s[n];
364 cc_unit ti = t[n];
372 { N bit, N bit -> int } N = n * sizeof(cc_unit) * 8 */
374 int ccn_cmp(cc_size n, const cc_unit *s, const cc_unit *t);
378 { N bit, M bit -> int } N = ns * sizeof(cc_unit) * 8 M = nt * sizeof(cc_unit) * 8 */
380 int ccn_cmpn(cc_size ns, const cc_unit *s,
381 cc_size nt, const cc_unit *t) {
391 { N bit, N bit -> N bit } N = n * sizeof(cc_unit) * 8 */
393 cc_unit ccn_sub(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit *t);
396 { N bit, sizeof(cc_unit) * 8 bit -> N bit } N = n * sizeof(cc_unit) * 8 */
398 cc_unit ccn_sub1(cc_size n, cc_unit *r, const cc_unit *s, cc_unit v);
401 { N bit, NT bit -> N bit NT <= N} N = n * sizeof(cc_unit) * 8 */
404 cc_unit ccn_subn(cc_size n, cc_unit *r,const cc_unit *s,
405 cc_size nt, const cc_unit *t) {
411 { N bit, N bit -> N bit } N = n * sizeof(cc_unit) * 8 */
413 cc_unit ccn_add(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit *t);
416 { N bit, sizeof(cc_unit) * 8 bit -> N bit } N = n * sizeof(cc_unit) * 8 */
418 cc_unit ccn_add1(cc_size n, cc_unit *r, const cc_unit *s, cc_unit v);
421 { N bit, NT bit -> N bit NT <= N} N = n * sizeof(cc_unit) * 8 */
424 cc_unit ccn_addn(cc_size n, cc_unit *r, const cc_unit *s,
425 cc_size nt, const cc_unit *t) {
430 void ccn_divmod(cc_size n, cc_unit *q, cc_unit *r, const cc_unit *s, const cc_unit *t);
434 void ccn_lcm(cc_size n, cc_unit *r2n, const cc_unit *s, const cc_unit *t);
438 { n bit, n bit -> 2 * n bit } n = count * sizeof(cc_unit) * 8 */
440 void ccn_mul(cc_size n, cc_unit *r_2n, const cc_unit *s, const cc_unit *t);
443 cc_unit ccn_mul1(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit v);
445 cc_unit ccn_addmul1(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit v);
449 {2 * n bit, n bit -> n bit } n = count * sizeof(cc_unit) * 8 */
451 void ccn_mod(cc_size n, cc_unit *r, const cc_unit *a_2n, const cc_unit *d);
457 void ccn_gcd(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit *t);
462 void ccn_gcdn(cc_size rn, cc_unit *r, cc_size sn, const cc_unit *s, cc_size tn, const cc_unit *t);
467 int ccn_read_uint(cc_size n, cc_unit *r, size_t data_size, const uint8_t *data);
476 size_t ccn_write_uint_size(cc_size n, const cc_unit *s);
480 regardless of the size of cc_unit.
489 void ccn_write_uint(cc_size n, const cc_unit *s, size_t out_size, void *out);
493 cc_size ccn_write_uint_padded(cc_size n, const cc_unit* s, size_t out_size, uint8_t* to)
508 size_t ccn_write_int_size(cc_size n, const cc_unit *s);
512 regardless of the size of cc_unit.
521 void ccn_write_int(cc_size n, const cc_unit *s, size_t out_size, void *out);
527 void ccn_sqr(cc_size n, cc_unit *r, const cc_unit *s) {
534 void ccn_set(cc_size n, cc_unit *r, const cc_unit *s);
537 void ccn_zero(cc_size n, cc_unit *r) {
545 void ccn_seti(cc_size n, cc_unit *r, cc_unit v) {
552 void ccn_setn(cc_size n, cc_unit *r, CC_UNUSED const cc_size s_size, const cc_unit *s) {
593 /* Swap units in r in place from cc_unit vector byte order to big endian byte order (or back). */
595 void ccn_swap(cc_size n, cc_unit *r) {
596 cc_unit *e;
598 cc_unit t = CC_UNIT_TO_BIG(*r);
607 void ccn_xor(cc_size n, cc_unit *r, const cc_unit *s, const cc_unit *t) {
615 void ccn_print(cc_size n, const cc_unit *s);
617 void ccn_lprint(cc_size n, const char *label, const cc_unit *s);
624 int ccn_random(cc_size n, cc_unit *r, struct ccrng_state *rng) {
634 int ccn_random_bits(cc_size nbits, cc_unit *r, struct ccrng_state *rng);