From aebc96e6efc369c09a95fb641ca90935930cf19b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 19 May 2016 04:13:47 +0300 Subject: rename the project --- cxx/include/aesnixx/api.hpp | 171 -------------------------------------------- 1 file changed, 171 deletions(-) delete mode 100644 cxx/include/aesnixx/api.hpp (limited to 'cxx/include/aesnixx/api.hpp') diff --git a/cxx/include/aesnixx/api.hpp b/cxx/include/aesnixx/api.hpp deleted file mode 100644 index 6995ae2..0000000 --- a/cxx/include/aesnixx/api.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/** - * \file - * \author Egor Tensin - * \date 2015 - * \copyright This file is licensed under the terms of the MIT License. - * See LICENSE.txt for details. - */ - -#pragma once - -#include "algorithm.hpp" -#include "mode.hpp" - -#include - -#include -#include - -namespace aesni -{ - template - struct Types; - - template - std::size_t get_number_of_rounds(); - - template - void from_string( - typename Types::Block&, - const char*); - - template - inline void from_string( - typename Types::Block& dest, - const std::string& src) - { - from_string(dest, src.c_str()); - } - - template - std::string to_string(const typename Types::Block&); - - template - std::string to_matrix_string(const typename Types::Block&); - - template - void from_string( - typename Types::Key&, - const char*); - - template - inline void from_string( - typename Types::Key& dest, - const std::string& src) - { - from_string(dest, src.c_str()); - } - - template - std::string to_string(const typename Types::Key&); - - template - inline void expand_key( - const typename Types::Key& key, - typename Types::RoundKeys& encryption_keys); - - template - inline void derive_decryption_keys( - const typename Types::RoundKeys& encryption_keys, - typename Types::RoundKeys& decryption_keys); - - template ::value>::type* = 0> - inline void encrypt_block( - const typename Types::Block& plaintext, - const typename Types::RoundKeys& round_keys, - typename Types::Block& iv, - typename Types::Block& ciphertext); - - template ::value>::type* = 0> - inline void encrypt_block( - const typename Types::Block& plaintext, - const typename Types::RoundKeys& round_keys, - typename Types::Block& ciphertext); - - template ::value>::type* = 0> - inline void encrypt_block( - const typename Types::Block& plaintext, - const typename Types::RoundKeys& round_keys, - typename Types::Block&, - typename Types::Block& ciphertext) - { - encrypt_block(plaintext, round_keys, ciphertext); - } - - template ::value>::type* = 0> - inline void decrypt_block( - const typename Types::Block& ciphertext, - const typename Types::RoundKeys& round_keys, - typename Types::Block& iv, - typename Types::Block& plaintext); - - template ::value>::type* = 0> - inline void decrypt_block( - const typename Types::Block& ciphertext, - const typename Types::RoundKeys& round_keys, - typename Types::Block& plaintext); - - template ::value>::type* = 0> - inline void decrypt_block( - const typename Types::Block& ciphertext, - const typename Types::RoundKeys& round_keys, - typename Types::Block&, - typename Types::Block& plaintext) - { - decrypt_block(ciphertext, round_keys, plaintext); - } - - template - struct EncryptWrapper - { - EncryptWrapper( - const typename Types::Key& key, - const typename Types::Block& iv) : iv(iv) - { - expand_key(key, encryption_keys); - } - - inline void encrypt_block( - const typename Types::Block& plaintext, - typename Types::Block& ciphertext) - { - aesni::encrypt_block( - plaintext, encryption_keys, iv, ciphertext); - } - - typename Types::Block iv; - typename Types::RoundKeys encryption_keys; - }; - - template - struct DecryptWrapper - { - DecryptWrapper( - const typename Types::Key& key, - const typename Types::Block& iv) : iv(iv) - { - typename Types::RoundKeys encryption_keys; - expand_key(key, encryption_keys); - - if (ModeUsesEncryptionKeysOnly::value) - { - decryption_keys = encryption_keys; - } - else - { - derive_decryption_keys(encryption_keys, decryption_keys); - } - } - - inline void decrypt_block( - const typename Types::Block& ciphertext, - typename Types::Block& plaintext) - { - aesni::decrypt_block( - ciphertext, decryption_keys, iv, plaintext); - } - - typename Types::Block iv; - typename Types::RoundKeys decryption_keys; - }; -} -- cgit v1.2.3