1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 00:28:10 +00:00

bignum: use the compiler's built in memory copy for bn_copy

This commit is contained in:
Alex Beregszaszi 2016-08-26 01:06:47 +01:00
parent d061139da9
commit 97454d9cbc
2 changed files with 4 additions and 10 deletions

View File

@ -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)
{

View File

@ -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);