Lines Matching +full:in2 +full:-
2 * Copyright (C) 2017 - This file is part of libecc project
7 * Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
22 * Compute out = (in1 * in2) & (2^(WORD_BYTES * wlimits) - 1).
28 * algorithm (Karatsuba, Toom-Cook, or FFT based algorithms)
42 * The function returns 0 on succes, -1 on error.
44 ATTRIBUTE_WARN_UNUSED_RET static int _nn_mul_low(nn_t out, nn_src_t in1, nn_src_t in2, in _nn_mul_low() argument
56 for (i = 0; i < in1->wlen; i++) { in _nn_mul_low()
60 for (j = 0; j < in2->wlen; j++) { in _nn_mul_low()
77 in1->val[i], in2->val[j]); in _nn_mul_low()
88 out->val[pos] = (word_t)(out->val[pos] + prod_low); in _nn_mul_low()
89 carry = (word_t)(prod_high + (out->val[pos] < prod_low)); in _nn_mul_low()
97 out->val[pos + 1] = (word_t)(out->val[pos + 1] + carry); in _nn_mul_low()
106 ATTRIBUTE_WARN_UNUSED_RET static int _nn_mul_low_aliased(nn_t out, nn_src_t in1, nn_src_t in2, in _nn_mul_low_aliased() argument
113 ret = _nn_mul_low(&out_cpy, in1, in2, wlimit); EG(ret, err); in _nn_mul_low_aliased()
124 int nn_mul_low(nn_t out, nn_src_t in1, nn_src_t in2, u8 wlimit) in nn_mul_low() argument
129 ret = nn_check_initialized(in2); EG(ret, err); in nn_mul_low()
132 if ((out == in1) || (out == in2)) { in nn_mul_low()
133 ret = _nn_mul_low_aliased(out, in1, in2, wlimit); in nn_mul_low()
135 ret = _nn_mul_low(out, in1, in2, wlimit); in nn_mul_low()
143 * Compute out = in1 * in2. 'out' is initialized by the function.
144 * The function returns 0 on success, -1 on error.
148 int nn_mul(nn_t out, nn_src_t in1, nn_src_t in2) in nn_mul() argument
153 ret = nn_check_initialized(in2); EG(ret, err); in nn_mul()
154 ret = nn_mul_low(out, in1, in2, (u8)(in1->wlen + in2->wlen)); in nn_mul()
167 * The function returns 0 on success, -1 on error.
178 * returns 0 on success, -1 on error.