mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
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:
committed by
Christian Helmuth
parent
8b4e2a21e4
commit
a2743dcaeb
31
repos/gems/include/aes_cbc_4k/aes_cbc_4k.h
Normal file
31
repos/gems/include/aes_cbc_4k/aes_cbc_4k.h
Normal 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_ */
|
||||
Reference in New Issue
Block a user