X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=ecdsa%2Fecc_chudnovsky.c;h=339c27ea4f676f73a564b7b0db28f1e741cdf9fc;hp=dd3433a3867c5b8503a965a635dc5a6a8212e702;hb=b8aa8d06134ce687993cb3148d66ebd86dbf1d6f;hpb=33d65e8032f77c1cbec1bc99e898affc96966c3c diff --git a/ecdsa/ecc_chudnovsky.c b/ecdsa/ecc_chudnovsky.c index dd3433a..339c27e 100644 --- a/ecdsa/ecc_chudnovsky.c +++ b/ecdsa/ecc_chudnovsky.c @@ -1,7 +1,7 @@ /* ecc_chudnovsky.c */ /* This file is part of the ARM-Crypto-Lib. - Copyright (C) 2006-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 @@ -27,7 +27,7 @@ #if 1 #include #include "bigint_io.h" -#include "uart_i.h" +#include "uart.h" #include #endif @@ -38,7 +38,7 @@ #define putchar(a) #endif -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){ if(!(p->x.wordv = malloc(length_B))){ printf_P(PSTR("DBG: XXX <%S %s %d>\n"), PSTR(__FILE__), __func__, __LINE__); return 1; @@ -77,7 +77,7 @@ uint8_t ecc_chudnovsky_point_alloc(ecc_chudnovsky_point_t* p, size_t length_B){ return 0; } -void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t* p){ +void ecc_chudnovsky_point_free(ecc_chudnovsky_point_t *p){ free(p->x.wordv); free(p->y.wordv); free(p->z1.wordv); @@ -378,7 +378,7 @@ 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){ + const ecc_curve_sp_t *curve){ uint16_t i; uint8_t s = 0; bigint_word_t v, t; @@ -404,7 +404,7 @@ uint8_t ecc_chudnovsky_double_and_add(ecc_chudnovsky_point_t *dest, return 0; } -uint8_t bigint_to_naf(uint8_t* dest, uint16_t *length, const bigint_t *src){ +uint8_t bigint_to_naf(uint8_t *dest, uint16_t *length, const bigint_t *src){ if(src->length_W == 0){ *dest = 0; *length = 2; @@ -443,7 +443,7 @@ uint8_t bigint_to_naf(uint8_t* dest, uint16_t *length, const bigint_t *src){ return 0; } -void print_naf(uint8_t* naf, uint16_t length){ +void print_naf(uint8_t *naf, uint16_t length){ if(!length){ return; } @@ -466,7 +466,7 @@ void print_naf(uint8_t* naf, uint16_t length){ 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){ if(k->length_W == 0 || p->y.length_W == 0){ bigint_set_zero(&dest->y); return 0; @@ -515,7 +515,7 @@ uint8_t ecc_chudnovsky_naf_multiplication(ecc_chudnovsky_point_t *dest, 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){ return ecc_chudnovsky_naf_multiplication(dest, k, p, curve); } @@ -526,6 +526,6 @@ uint8_t ecc_chudnovsky_multipy_and_sum(ecc_chudnovsky_point_t *dest, const ecc_chudnovsky_point_t *p, const bigint_t *l, const ecc_chudnovsky_point_t *q, - const ecc_curve_sp_t* curve){ + const ecc_curve_sp_t *curve){ return ecc_chudnovsky_naf_multiplication(dest, k, p, curve); }