X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=bigint%2Fbigint.c;h=3e2f0eb295241651d679faa9f04f3df723db01d1;hb=a012cfa921853fb9b8bd484981ab471a9ba25ec9;hp=7004e0dc1cb6640cadcf5ec2929e8f67f75fc40c;hpb=c9c11514d91b8c19f77d65ac051b998bd99048b0;p=avr-crypto-lib.git diff --git a/bigint/bigint.c b/bigint/bigint.c index 7004e0d..3e2f0eb 100644 --- a/bigint/bigint.c +++ b/bigint/bigint.c @@ -77,15 +77,14 @@ void bigint_adjust(bigint_t* a){ /******************************************************************************/ void bigint_copy(bigint_t* dest, const bigint_t* src){ - memcpy(dest->wordv, src->wordv, src->length_B); dest->length_B = src->length_B; dest->info = src->info; + memcpy(dest->wordv, src->wordv, src->length_B); } /******************************************************************************/ /* this should be implemented in assembly */ -/* void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){ uint16_t t=0, i; if(a->length_B < b->length_B){ @@ -105,7 +104,7 @@ void bigint_add_u(bigint_t* dest, const bigint_t* a, const bigint_t* b){ dest->length_B = i; bigint_adjust(dest); } -*/ + /******************************************************************************/ /* this should be implemented in assembly */ @@ -612,7 +611,6 @@ void bigint_reduce(bigint_t* a, const bigint_t* r){ while(bigint_cmp_u(a,r)>=0){ bigint_sub_u(a,a,r); } - bigint_adjust(a); } /******************************************************************************/