Skip to content

Commit

Permalink
should be an OR operation in bf_lambda_load_bits
Browse files Browse the repository at this point in the history
  • Loading branch information
shibammukherjee committed Feb 5, 2025
1 parent 0cb63e5 commit 5a6dab6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions fields.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ ATTR_CONST ATTR_ALWAYS_INLINE static inline bf64_t bf64_from_bit(uint8_t bit) {
}

// GF(2^128) implementation

ATTR_PURE ATTR_ALWAYS_INLINE static inline bf128_t bf128_load_bits(const uint8_t* src) {
bf128_t ret;
uint8_t tmp[16];
memset(tmp, 0, sizeof(tmp));
for(unsigned int i = 0; i < 16; i++) {
for (unsigned int j = 0; j < 8; j++) {
tmp[i] &= src[i*8 + j ] << j;
tmp[i] |= src[i*8 + j] << j;
}
}
#if defined(FAEST_IS_BIG_ENDIAN)
Expand Down Expand Up @@ -291,7 +291,7 @@ ATTR_PURE ATTR_ALWAYS_INLINE static inline bf192_t bf192_load_bits(const uint8_t
uint8_t tmp[24];
for(unsigned int i = 0; i < 24; i++) {
for (unsigned int j = 0; j < 8; j++) {
tmp[i] &= src[i*8 + j ] << j;
tmp[i] |= src[i*8 + j ] << j;
}
}
#if defined(FAEST_IS_BIG_ENDIAN)
Expand Down Expand Up @@ -396,7 +396,7 @@ ATTR_PURE ATTR_ALWAYS_INLINE static inline bf256_t bf256_load_bits(const uint8_t
uint8_t tmp[32];
for(unsigned int i = 0; i < 32; i++) {
for (unsigned int j = 0; j < 8; j++) {
tmp[i] &= src[i*8 + j ] << j;
tmp[i] |= src[i*8 + j ] << j;
}
}
#if defined(FAEST_IS_BIG_ENDIAN)
Expand Down
2 changes: 1 addition & 1 deletion tests/aes_prove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ BOOST_DATA_TEST_CASE(aes_prove_verify, all_parameters, param_id) {
}
// masked witness d = u ^ w
std::vector<uint8_t> d(ell_hat, 0x13);
for (size_t i = 0; i < ell_bytes; ++i) {
for (size_t i = 0; i < ell_hat; ++i) {
d[i] = u[i] ^ w[i];
}

Expand Down

0 comments on commit 5a6dab6

Please sign in to comment.