X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=ecdsa%2Fecc.h;h=df613f63fd762e7c6dbe4fb669232bb7147ba2f9;hp=99dd4f4bc3998306e99e1964b047d0e7f83bbf77;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=56e75f661dfea7104d76421be6059f098d3236d4 diff --git a/ecdsa/ecc.h b/ecdsa/ecc.h index 99dd4f4..df613f6 100644 --- a/ecdsa/ecc.h +++ b/ecdsa/ecc.h @@ -1,7 +1,7 @@ /* ecc.h */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2012 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,21 +35,22 @@ typedef struct { bigint_t y; } ecc_affine_point_t; -typedef struct __attribute__((packed)){ +typedef union __attribute__((packed)){ ecc_affine_point_t affine; ecc_chudnovsky_point_t chudnovsky; } ecc_combi_point_t; typedef struct { - bigint_t* p; - bigint_t* b; + bigint_t *p; + bigint_t *n; + bigint_t *b; int (*reduce_p)(bigint_t*); } ecc_curve_sp_t; -uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t* p, size_t length_B); +uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t *p, size_t length_B); -void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t* p); +void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t *p); void ecc_chudnovsky_point_print(const ecc_chudnovsky_point_t *p); @@ -71,15 +72,15 @@ uint8_t ecc_chudnovsky_point_add_sp(ecc_chudnovsky_point_t *dest, uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest, const bigint_t *k, const ecc_chudnovsky_point_t *p, - const ecc_curve_sp_t* curve); -uint8_t bigint_to_naf(uint8_t* dest, uint16_t *length, const bigint_t *src); + const ecc_curve_sp_t *curve); +uint8_t bigint_to_naf(uint8_t *dest, uint16_t *length, const bigint_t *src); uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest, const bigint_t *k, const ecc_chudnovsky_point_t *p, - const ecc_curve_sp_t* curve); + const ecc_curve_sp_t *curve); uint8_t ecc_chudnovsky_multiplication(ecc_chudnovsky_point_t *dest, const bigint_t *k, const ecc_chudnovsky_point_t *p, - const ecc_curve_sp_t* curve); + const ecc_curve_sp_t *curve); #endif /* ECC_H_ */