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>
25 * Compute out = in1 * in2 mod p. 'out' parameter must have been initialized
26 * by the caller. Returns 0 on success, -1 on error.
30 int fp_mul(fp_t out, fp_src_t in1, fp_src_t in2) in fp_mul() argument
35 ret = fp_check_initialized(in2); EG(ret, err); in fp_mul()
38 MUST_HAVE(out->ctx == in1->ctx, ret, err); in fp_mul()
39 MUST_HAVE(out->ctx == in2->ctx, ret, err); in fp_mul()
41 ret = nn_mul(&(out->fp_val), &(in1->fp_val), &(in2->fp_val)); EG(ret, err); in fp_mul()
42 ret = nn_mod_unshifted(&(out->fp_val), &(out->fp_val), &(in1->ctx->p_normalized), in fp_mul()
43 in1->ctx->p_reciprocal, in1->ctx->p_shift); in fp_mul()
51 * by the caller. Returns 0 on success, -1 on error.
61 * x^(p-1) = 1 mod (p) means that x^(p-2) mod(p) is the modular
76 MUST_HAVE(out->ctx == in->ctx, ret, err); in fp_inv()
79 …ret = nn_modinv_fermat_redc(&(out->fp_val), &(in->fp_val), &(in->ctx->p), &(in->ctx->r), &(in->ctx… in fp_inv()
86 * Compute out = w^-1 mod p. 'out' parameter must have been initialized
87 * by the caller. Returns 0 on success, -1 on error.
95 ret = nn_modinv_word(&(out->fp_val), w, &(out->ctx->p)); in fp_inv_word()
103 * by the caller. Returns 0 on success, -1 on error.
115 MUST_HAVE(out->ctx == num->ctx, ret, err); in fp_div()
116 MUST_HAVE(out->ctx == den->ctx, ret, err); in fp_div()