2015-04-09 19:22:09 +02:00
|
|
|
#include "EncryptedBlock.h"
|
|
|
|
|
|
|
|
namespace blockstore {
|
|
|
|
namespace encrypted {
|
|
|
|
|
2015-04-09 20:14:12 +02:00
|
|
|
EncryptedBlock::EncryptedBlock(std::unique_ptr<Block> baseBlock, const EncryptionKey &encKey)
|
|
|
|
:Block(baseBlock->key()), _baseBlock(std::move(baseBlock)), _encKey(encKey) {
|
2015-04-09 19:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const void *EncryptedBlock::data() const {
|
|
|
|
return _baseBlock->data();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EncryptedBlock::write(const void *source, uint64_t offset, uint64_t size) {
|
|
|
|
return _baseBlock->write(source, offset, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EncryptedBlock::flush() {
|
|
|
|
return _baseBlock->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t EncryptedBlock::size() const {
|
|
|
|
return _baseBlock->size();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|