Support decryption with multiple keys

This commit is contained in:
Vitaliy Filippov
2026-05-19 17:19:35 +03:00
parent 652ca3f1c3
commit f9975311ea
8 changed files with 135 additions and 31 deletions
+6 -4
View File
@@ -16,7 +16,7 @@ class op_aes_xts_encrypt_t
EVP_CIPHER_CTX *ctx = NULL;
#endif
uint64_t start_offset = 0;
const uint8_t *key = NULL;
uint8_t *key = NULL;
size_t offset = 0;
size_t block_size = 0;
uint8_t *tmp = NULL;
@@ -31,7 +31,7 @@ public:
~op_aes_xts_encrypt_t();
inline bool has_buffered() { return encrypted; };
void start(const uint8_t *key, uint64_t start_offset, size_t block_size);
void start(uint8_t *key, uint64_t start_offset, size_t block_size);
void update(uint8_t *in, size_t max_in, uint8_t *out, size_t max_out, size_t & done_in, size_t & done_out);
};
@@ -43,7 +43,9 @@ class op_aes_xts_decrypt_t
EVP_CIPHER_CTX *ctx = NULL;
#endif
uint64_t start_offset = 0;
const uint8_t *key = NULL;
uint8_t **key_chain = NULL;
size_t chain_size = 0;
uint8_t *key_indexes = NULL;
size_t offset = 0;
size_t block_size = 0;
uint8_t *tmp = NULL;
@@ -58,7 +60,7 @@ public:
~op_aes_xts_decrypt_t();
inline bool has_buffered() { return decrypted; };
void start(const uint8_t *key, uint64_t start_offset, size_t block_size);
void start(uint8_t **key_chain, size_t chain_size, uint8_t *key_indexes, uint64_t start_offset, size_t block_size);
void update(uint8_t *in, size_t max_in, uint8_t *out, size_t max_out, size_t & done_in, size_t & done_out);
};