Skip to content

Commit

Permalink
Remove fixed block size implementations of XEX encryption
Browse files Browse the repository at this point in the history
Somewhat inexplicably this saves 120 KB in the final shared object
  • Loading branch information
randombit committed Jun 22, 2024
1 parent a55851c commit 5f1c07c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/lib/block/block_cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,6 @@ class Block_Cipher_Fixed_Params : public BaseClass {

size_t block_size() const final { return BS; }

// override to take advantage of compile time constant block size
void encrypt_n_xex(uint8_t data[], const uint8_t mask[], size_t blocks) const final {
xor_buf(data, mask, blocks * BS);
this->encrypt_n(data, data, blocks);
xor_buf(data, mask, blocks * BS);
}

void decrypt_n_xex(uint8_t data[], const uint8_t mask[], size_t blocks) const final {
xor_buf(data, mask, blocks * BS);
this->decrypt_n(data, data, blocks);
xor_buf(data, mask, blocks * BS);
}

Key_Length_Specification key_spec() const final { return Key_Length_Specification(KMIN, KMAX, KMOD); }
};

Expand Down

0 comments on commit 5f1c07c

Please sign in to comment.