MOTION
0.01
Framework for mixed-protocol multi-party computation
|
Go to the documentation of this file.
31 #include <openssl/aes.h>
32 #include <openssl/evp.h>
45 void SetKey(
const std::uint8_t* key);
47 void SetKey(
const std::byte* key);
58 std::vector<std::byte>
Encrypt(
const std::size_t bytes);
60 std::vector<std::byte>
Encrypt(
const std::byte* input,
const std::size_t bytes);
62 std::vector<std::byte>
FixedKeyAes(
const std::byte* x,
const std::uint64_t i,
63 const std::size_t num = 1);
66 void Mmo(std::byte* input);
77 alignas(16) std::array<std::byte, kAesRoundKeysSize128> round_keys_;
78 using EvpCipherCtxPointer = std::unique_ptr<EVP_CIPHER_CTX, decltype(&EVP_CIPHER_CTX_free)>;
79 static constexpr
auto MakeCipherCtx = []() {
80 return EvpCipherCtxPointer(EVP_CIPHER_CTX_new(), &EVP_CIPHER_CTX_free);
83 EvpCipherCtxPointer ctx_ = MakeCipherCtx();
85 std::array<std::uint8_t, AES_BLOCK_SIZE> key_;
86 bool contains_key_{
false};
87 std::size_t offset_{0};
void AesniKeyExpansion128(void *round_keys_input)
Definition: aesni_primitives.cpp:55
std::size_t SetOffset(std::size_t new_offset)
Definition: pseudo_random_generator.h:53
void SetKey(const std::uint8_t *key)
Definition: pseudo_random_generator.cpp:32
static void EncryptBlock(EVP_CIPHER_CTX *ctx, const std::byte *in, std::byte *output)
Definition: pseudo_random_generator.cpp:128
void AesniMmoSingle(const void *round_keys_input, void *input)
Definition: aesni_primitives.cpp:280
constexpr std::size_t kAesKeySize128
Definition: aesni_primitives.h:28
Definition: motion_base_provider.h:35
__uint128_t uint128_t
Definition: pseudo_random_generator.h:37
bool ContainsKey()
Definition: pseudo_random_generator.h:49
Definition: pseudo_random_generator.h:41
std::vector< std::byte > Encrypt(const std::size_t bytes)
Definition: pseudo_random_generator.cpp:46
std::vector< std::byte > FixedKeyAes(const std::byte *x, const std::uint64_t i, const std::size_t num=1)
Definition: pseudo_random_generator.cpp:94
void Mmo(std::byte *input)
Definition: pseudo_random_generator.cpp:148
const void * GetRoundKeys() const
Definition: pseudo_random_generator.h:51
void swap(ReusablePromise< R, MutexType, ConditionVariableType > &lhs, ReusablePromise< R, MutexType, ConditionVariableType > &rhs) noexcept
Definition: reusable_future.h:270