genode/repos/gems/include/aes_cbc_4k/aes_cbc_4k.h
Norman Feske a2743dcaeb Library for the AES-CBC en/decryption of 4K blocks
The 'aes_cbc_4k' library is simple wrapper around libsparkcrypto to
serve as a backend for storage encryption. It operates on data chunks of
4 KiB and uses AES-CBC while incorporating the block number and the
private key as salt values.
2019-04-09 12:30:35 +02:00

32 lines
766 B
C++

/*
* \brief Interface for AES CBC encryption/decrytion of 4KiB data blocks
* \author Norman Feske
* \date 2018-12-20
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _AES_CBC_4K_H_
#define _AES_CBC_4K_H_
namespace Aes_cbc_4k {
struct Key { char values[32]; };
struct Block { char values[4096]; };
struct Plaintext : Block { };
struct Ciphertext : Block { };
struct Block_number { Genode::uint64_t value; };
void encrypt(Key const &, Block_number, Plaintext const &, Ciphertext &);
void decrypt(Key const &, Block_number, Ciphertext const &, Plaintext &);
}
#endif /* _AES_CBC_4K_H_ */