3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2012 Daniel Otte (daniel.otte@rub.de)
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 } ecc_chudnovsky_point_t;
36 typedef struct __attribute__((packed)){
37 ecc_affine_point_t affine;
38 ecc_chudnovsky_point_t chudnovsky;
44 int (*reduce_p)(bigint_t*);
47 void ecc_chudnovsky_point_print(const ecc_chudnovsky_point_t *p);
50 uint8_t ecc_affine_to_chudnovsky_point(ecc_chudnovsky_point_t *dest,
51 const ecc_affine_point_t *src);
52 uint8_t ecc_chudnovsky_to_affine_point(ecc_affine_point_t *dest,
53 const ecc_chudnovsky_point_t *src,
54 const ecc_curve_sp_t *curve);
55 uint8_t ecc_chudnovsky_point_double_sp(ecc_chudnovsky_point_t *dest,
56 const ecc_chudnovsky_point_t *a,
57 const ecc_curve_sp_t *curve);
58 void ecc_chudnovsky_point_copy(ecc_chudnovsky_point_t *dest,
59 const ecc_chudnovsky_point_t *src);
60 uint8_t ecc_chudnovsky_point_add_sp(ecc_chudnovsky_point_t *dest,
61 const ecc_chudnovsky_point_t *a,
62 const ecc_chudnovsky_point_t *b,
63 const ecc_curve_sp_t *curve);
64 uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest,
66 const ecc_chudnovsky_point_t *p,
67 const ecc_curve_sp_t* curve);
68 uint8_t bigint_to_naf(uint8_t* dest, uint16_t *length, const bigint_t *src);
69 uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest,
71 const ecc_chudnovsky_point_t *p,
72 const ecc_curve_sp_t* curve);
73 uint8_t ecc_chudnovsky_multiplication(ecc_chudnovsky_point_t *dest,
75 const ecc_chudnovsky_point_t *p,
76 const ecc_curve_sp_t* curve);