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.
This commit is contained in:
Norman Feske
2018-12-20 16:49:14 +01:00
committed by Christian Helmuth
parent 8b4e2a21e4
commit a2743dcaeb
8 changed files with 290 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*
* \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_ */