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 mod p in the Montgomery form.
24 * Returns 0 on success, -1 on error.
28 int fp_add_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_add_monty() argument
30 return fp_add(out, in1, in2); in fp_add_monty()
33 /* Compute out = in1 - in2 mod p in the Montgomery form.
35 * Returns 0 on success, -1 on error.
39 int fp_sub_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_sub_monty() argument
41 return fp_sub(out, in1, in2); in fp_sub_monty()
44 /* Compute out = in1 * in2 mod p in the Montgomery form.
46 * Returns 0 on success, -1 on error.
50 int fp_mul_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_mul_monty() argument
52 return fp_mul_redc1(out, in1, in2); in fp_mul_monty()
57 * Returns 0 on success, -1 on error.
67 * Compute out such that in1 = out * in2 mod p in the Montgomery form.
69 * Returns 0 on success, -1 on error. out must be initialized by the caller.
73 int fp_div_monty(fp_t out, fp_src_t in1, fp_src_t in2) in fp_div_monty() argument
78 ret = fp_check_initialized(in2); EG(ret, err); in fp_div_monty()
81 MUST_HAVE((out->ctx == in1->ctx), ret, err); in fp_div_monty()
82 MUST_HAVE((out->ctx == in2->ctx), ret, err); in fp_div_monty()
84 MUST_HAVE(!fp_iszero(in2, &iszero) && (!iszero), ret, err); in fp_div_monty()
86 ret = fp_div(out, in1, in2); EG(ret, err); in fp_div_monty()