aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-04-25 12:57:41 +0000
committerlloyd <[email protected]>2011-04-25 12:57:41 +0000
commit456140c2dd99f0071b878060903e7521c438fd33 (patch)
tree534ed73a33d932e82cbb594a884a29e4538e36a8 /src
parent7c824a394190a9aedd373a4e2d72fa6b36869f4c (diff)
Rename AES_XXX_Intel to AES_XXX_NI, since AMD's Bulldozer will also
support AES-NI.
Diffstat (limited to 'src')
-rw-r--r--src/block/aes_ni/aes_ni.cpp (renamed from src/block/aes_intel/aes_intel.cpp)28
-rw-r--r--src/block/aes_ni/aes_ni.h (renamed from src/block/aes_intel/aes_intel.h)24
-rw-r--r--src/block/aes_ni/info.txt (renamed from src/block/aes_intel/info.txt)2
-rw-r--r--src/engine/aes_isa_eng/aes_isa_engine.cpp12
4 files changed, 33 insertions, 33 deletions
diff --git a/src/block/aes_intel/aes_intel.cpp b/src/block/aes_ni/aes_ni.cpp
index a2e660f2c..3ee0e608c 100644
--- a/src/block/aes_intel/aes_intel.cpp
+++ b/src/block/aes_ni/aes_ni.cpp
@@ -1,11 +1,11 @@
/*
-* AES using Intel's AES-NI instructions
+* AES using AES-NI instructions
* (C) 2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
-#include <botan/aes_intel.h>
+#include <botan/aes_ni.h>
#include <botan/loadstor.h>
#include <wmmintrin.h>
@@ -103,7 +103,7 @@ __m128i aes_256_key_expansion(__m128i key, __m128i key2)
/*
* AES-128 Encryption
*/
-void AES_128_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_128_NI::encrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -179,7 +179,7 @@ void AES_128_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-128 Decryption
*/
-void AES_128_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_128_NI::decrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -255,7 +255,7 @@ void AES_128_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-128 Key Schedule
*/
-void AES_128_Intel::key_schedule(const byte key[], size_t)
+void AES_128_NI::key_schedule(const byte key[], size_t)
{
#define AES_128_key_exp(K, RCON) \
aes_128_key_expansion(K, _mm_aeskeygenassist_si128(K, RCON))
@@ -304,7 +304,7 @@ void AES_128_Intel::key_schedule(const byte key[], size_t)
/*
* Clear memory of sensitive data
*/
-void AES_128_Intel::clear()
+void AES_128_NI::clear()
{
zeroise(EK);
zeroise(DK);
@@ -313,7 +313,7 @@ void AES_128_Intel::clear()
/*
* AES-192 Encryption
*/
-void AES_192_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_192_NI::encrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -395,7 +395,7 @@ void AES_192_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-192 Decryption
*/
-void AES_192_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_192_NI::decrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -477,7 +477,7 @@ void AES_192_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-192 Key Schedule
*/
-void AES_192_Intel::key_schedule(const byte key[], size_t)
+void AES_192_NI::key_schedule(const byte key[], size_t)
{
__m128i K0 = _mm_loadu_si128((const __m128i*)(key));
__m128i K1 = _mm_loadu_si128((const __m128i*)(key + 8));
@@ -520,7 +520,7 @@ void AES_192_Intel::key_schedule(const byte key[], size_t)
/*
* Clear memory of sensitive data
*/
-void AES_192_Intel::clear()
+void AES_192_NI::clear()
{
zeroise(EK);
zeroise(DK);
@@ -529,7 +529,7 @@ void AES_192_Intel::clear()
/*
* AES-256 Encryption
*/
-void AES_256_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_256_NI::encrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -617,7 +617,7 @@ void AES_256_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-256 Decryption
*/
-void AES_256_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
+void AES_256_NI::decrypt_n(const byte in[], byte out[], size_t blocks) const
{
const __m128i* in_mm = (const __m128i*)in;
__m128i* out_mm = (__m128i*)out;
@@ -705,7 +705,7 @@ void AES_256_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const
/*
* AES-256 Key Schedule
*/
-void AES_256_Intel::key_schedule(const byte key[], size_t)
+void AES_256_NI::key_schedule(const byte key[], size_t)
{
__m128i K0 = _mm_loadu_si128((const __m128i*)(key));
__m128i K1 = _mm_loadu_si128((const __m128i*)(key + 16));
@@ -770,7 +770,7 @@ void AES_256_Intel::key_schedule(const byte key[], size_t)
/*
* Clear memory of sensitive data
*/
-void AES_256_Intel::clear()
+void AES_256_NI::clear()
{
zeroise(EK);
zeroise(DK);
diff --git a/src/block/aes_intel/aes_intel.h b/src/block/aes_ni/aes_ni.h
index a8e6b53e8..ae9e5b3f4 100644
--- a/src/block/aes_intel/aes_intel.h
+++ b/src/block/aes_ni/aes_ni.h
@@ -1,12 +1,12 @@
/*
-* AES using Intel's AES-NI instructions
+* AES using AES-NI instructions
* (C) 2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
-#ifndef BOTAN_AES_INTEL_H__
-#define BOTAN_AES_INTEL_H__
+#ifndef BOTAN_AES_NI_H__
+#define BOTAN_AES_NI_H__
#include <botan/block_cipher.h>
@@ -15,7 +15,7 @@ namespace Botan {
/**
* AES-128 using AES-NI
*/
-class BOTAN_DLL AES_128_Intel : public Block_Cipher_Fixed_Params<16, 16>
+class BOTAN_DLL AES_128_NI : public Block_Cipher_Fixed_Params<16, 16>
{
public:
size_t parallelism() const { return 4; }
@@ -25,9 +25,9 @@ class BOTAN_DLL AES_128_Intel : public Block_Cipher_Fixed_Params<16, 16>
void clear();
std::string name() const { return "AES-128"; }
- BlockCipher* clone() const { return new AES_128_Intel; }
+ BlockCipher* clone() const { return new AES_128_NI; }
- AES_128_Intel() : EK(44), DK(44) { }
+ AES_128_NI() : EK(44), DK(44) { }
private:
void key_schedule(const byte[], size_t);
@@ -37,7 +37,7 @@ class BOTAN_DLL AES_128_Intel : public Block_Cipher_Fixed_Params<16, 16>
/**
* AES-192 using AES-NI
*/
-class BOTAN_DLL AES_192_Intel : public Block_Cipher_Fixed_Params<16, 24>
+class BOTAN_DLL AES_192_NI : public Block_Cipher_Fixed_Params<16, 24>
{
public:
size_t parallelism() const { return 4; }
@@ -47,9 +47,9 @@ class BOTAN_DLL AES_192_Intel : public Block_Cipher_Fixed_Params<16, 24>
void clear();
std::string name() const { return "AES-192"; }
- BlockCipher* clone() const { return new AES_192_Intel; }
+ BlockCipher* clone() const { return new AES_192_NI; }
- AES_192_Intel() : EK(52), DK(52) { }
+ AES_192_NI() : EK(52), DK(52) { }
private:
void key_schedule(const byte[], size_t);
@@ -59,7 +59,7 @@ class BOTAN_DLL AES_192_Intel : public Block_Cipher_Fixed_Params<16, 24>
/**
* AES-256 using AES-NI
*/
-class BOTAN_DLL AES_256_Intel : public Block_Cipher_Fixed_Params<16, 32>
+class BOTAN_DLL AES_256_NI : public Block_Cipher_Fixed_Params<16, 32>
{
public:
size_t parallelism() const { return 4; }
@@ -69,9 +69,9 @@ class BOTAN_DLL AES_256_Intel : public Block_Cipher_Fixed_Params<16, 32>
void clear();
std::string name() const { return "AES-256"; }
- BlockCipher* clone() const { return new AES_256_Intel; }
+ BlockCipher* clone() const { return new AES_256_NI; }
- AES_256_Intel() : EK(60), DK(60) { }
+ AES_256_NI() : EK(60), DK(60) { }
private:
void key_schedule(const byte[], size_t);
diff --git a/src/block/aes_intel/info.txt b/src/block/aes_ni/info.txt
index 8bf0f07ee..597948fc3 100644
--- a/src/block/aes_intel/info.txt
+++ b/src/block/aes_ni/info.txt
@@ -1,4 +1,4 @@
-define AES_INTEL
+define AES_NI
load_on auto
diff --git a/src/engine/aes_isa_eng/aes_isa_engine.cpp b/src/engine/aes_isa_eng/aes_isa_engine.cpp
index 7f541d583..e56f6e9ca 100644
--- a/src/engine/aes_isa_eng/aes_isa_engine.cpp
+++ b/src/engine/aes_isa_eng/aes_isa_engine.cpp
@@ -8,8 +8,8 @@
#include <botan/internal/aes_isa_engine.h>
#include <botan/cpuid.h>
-#if defined(BOTAN_HAS_AES_INTEL)
- #include <botan/aes_intel.h>
+#if defined(BOTAN_HAS_AES_NI)
+ #include <botan/aes_ni.h>
#endif
namespace Botan {
@@ -18,15 +18,15 @@ BlockCipher*
AES_ISA_Engine::find_block_cipher(const SCAN_Name& request,
Algorithm_Factory&) const
{
-#if defined(BOTAN_HAS_AES_INTEL)
+#if defined(BOTAN_HAS_AES_NI)
if(CPUID::has_aes_ni())
{
if(request.algo_name() == "AES-128")
- return new AES_128_Intel;
+ return new AES_128_NI;
if(request.algo_name() == "AES-192")
- return new AES_192_Intel;
+ return new AES_192_NI;
if(request.algo_name() == "AES-256")
- return new AES_256_Intel;
+ return new AES_256_NI;
}
#endif