]> git.bitcoin.ninja Git - rust-lightning/blob - src/util/rust_crypto_nonstd_arch.c
Merge pull request #20 from TheBlueMatt/master
[rust-lightning] / src / util / rust_crypto_nonstd_arch.c
1 #include <stdint.h>
2 #include <stdlib.h>
3
4 uint32_t rust_crypto_util_fixed_time_eq_asm(uint8_t* lhsp, uint8_t* rhsp, size_t count) {
5         if (count == 0) {
6                 return 1;
7         }
8         uint8_t result = 0;
9         for (size_t i = 0; i < count; i++) {
10                 result |= (lhsp[i] ^ rhsp[i]);
11         }
12         return result;
13 }