1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include "curve448.h"
#include "ecc.h"
#include "ecc-internal.h"
void
curve448_mul (uint8_t *q, const uint8_t *n, const uint8_t *p)
{
const struct ecc_modulo *m = &_nettle_curve448.p;
mp_size_t itch;
mp_limb_t *x;
itch = m->size + ECC_MUL_M_ITCH(m->size);
x = gmp_alloc_limbs (itch);
mpn_set_base256_le (x, m->size, p, CURVE448_SIZE);
ecc_mul_m (m, 39081, 2, 446, x, n, x, x + m->size);
mpn_get_base256_le (q, CURVE448_SIZE, x, m->size);
gmp_free_limbs (x, itch);
}
|