mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
bignum: use the compiler's built in memory copy for bn_copy
This commit is contained in:
parent
d061139da9
commit
97454d9cbc
9
bignum.c
9
bignum.c
@ -182,15 +182,6 @@ void bn_load_uint64(uint64_t in_number, bignum256 *out_number)
|
||||
out_number->val[8] = 0;
|
||||
}
|
||||
|
||||
// copies number a to b
|
||||
void bn_copy(bignum256 *a, bignum256 *b)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 9; i++) {
|
||||
b->val[i] = a->val[i];
|
||||
}
|
||||
}
|
||||
|
||||
// sets a bignum to zero.
|
||||
void bn_zero(bignum256 *a)
|
||||
{
|
||||
|
5
bignum.h
5
bignum.h
@ -58,7 +58,10 @@ void bn_load_uint32(uint32_t in_number, bignum256 *out_number);
|
||||
|
||||
void bn_load_uint64(uint64_t in_number, bignum256 *out_number);
|
||||
|
||||
void bn_copy(bignum256 *a, bignum256 *b);
|
||||
// copies number a to b
|
||||
static inline void bn_copy(const bignum256 *a, bignum256 *b) {
|
||||
*b = *a;
|
||||
}
|
||||
|
||||
void bn_zero(bignum256 *a);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user