X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=bigint%2Fbigint.h;h=d07713dfacc5bec478d7ade48cc069fc63c0bef8;hb=10951fe0bb7dae5229dff9408d8157490005590c;hp=f9097953e7bc8dbaf34b31e068808fcd2c64584d;hpb=d796b12dbb838974705d995369161d3836f9dad2;p=avr-crypto-lib.git diff --git a/bigint/bigint.h b/bigint/bigint.h index f909795..d07713d 100644 --- a/bigint/bigint.h +++ b/bigint/bigint.h @@ -32,7 +32,7 @@ #include #include -#define BIGINT_WORD_SIZE 8 +#define BIGINT_WORD_SIZE 32 #if BIGINT_WORD_SIZE == 8 typedef uint8_t bigint_word_t; @@ -68,8 +68,8 @@ typedef struct{ /******************************************************************************/ void bigint_adjust(bigint_t *a); -uint32_t bigint_get_first_set_bit(const bigint_t *a); -uint32_t bigint_get_last_set_bit(const bigint_t *a); +int32_t bigint_get_first_set_bit(const bigint_t *a); +int32_t bigint_get_last_set_bit(const bigint_t *a); bigint_length_t bigint_length_b(const bigint_t *a); bigint_length_t bigint_length_B(const bigint_t *a); void bigint_copy(bigint_t *dest, const bigint_t *src); @@ -80,7 +80,10 @@ int8_t bigint_cmp_u(const bigint_t * a, const bigint_t * b); void bigint_add_s(bigint_t *dest, const bigint_t *a, const bigint_t *b); void bigint_sub_s(bigint_t *dest, const bigint_t *a, const bigint_t *b); int8_t bigint_cmp_s(const bigint_t *a, const bigint_t *b); +void bigint_shiftleft_bits(bigint_t *a, uint8_t shift); void bigint_shiftleft(bigint_t *a, bigint_length_t shift); +void bigint_shiftright_1bit(bigint_t *a); +void bigint_shiftright_1word(bigint_t *a); void bigint_shiftright(bigint_t *a, bigint_length_t shift); void bigint_xor(bigint_t *dest, const bigint_t *a); void bigint_set_zero(bigint_t *a);