aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/openssl')
-rw-r--r--src/engine/openssl/arc4_openssl.cpp28
-rw-r--r--src/engine/openssl/bn_powm.cpp28
-rw-r--r--src/engine/openssl/bn_wrap.cpp82
-rw-r--r--src/engine/openssl/bn_wrap.h22
-rw-r--r--src/engine/openssl/eng_ossl.h16
-rw-r--r--src/engine/openssl/ossl_bc.cpp70
-rw-r--r--src/engine/openssl/ossl_dh.cpp28
-rw-r--r--src/engine/openssl/ossl_dsa.cpp34
-rw-r--r--src/engine/openssl/ossl_elg.cpp34
-rw-r--r--src/engine/openssl/ossl_if.cpp34
-rw-r--r--src/engine/openssl/ossl_md.cpp58
-rw-r--r--src/engine/openssl/ossl_nr.cpp34
12 files changed, 246 insertions, 222 deletions
diff --git a/src/engine/openssl/arc4_openssl.cpp b/src/engine/openssl/arc4_openssl.cpp
index 09fb52919..08ed3eb10 100644
--- a/src/engine/openssl/arc4_openssl.cpp
+++ b/src/engine/openssl/arc4_openssl.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL ARC4 Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL ARC4
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/parsing.h>
@@ -31,9 +33,9 @@ class ARC4_OpenSSL : public StreamCipher
RC4_KEY state;
};
-/*************************************************
-* Return the name of this type *
-*************************************************/
+/*
+* Return the name of this type
+*/
std::string ARC4_OpenSSL::name() const
{
if(SKIP == 0) return "ARC4";
@@ -41,9 +43,9 @@ std::string ARC4_OpenSSL::name() const
else return "RC4_skip(" + to_string(SKIP) + ")";
}
-/*************************************************
-* ARC4 Key Schedule *
-*************************************************/
+/*
+* ARC4 Key Schedule
+*/
void ARC4_OpenSSL::key_schedule(const byte key[], u32bit length)
{
RC4_set_key(&state, length, key);
@@ -52,9 +54,9 @@ void ARC4_OpenSSL::key_schedule(const byte key[], u32bit length)
RC4(&state, 1, &dummy, &dummy);
}
-/*************************************************
-* ARC4 Encryption *
-*************************************************/
+/*
+* ARC4 Encryption
+*/
void ARC4_OpenSSL::cipher(const byte in[], byte out[], u32bit length)
{
RC4(&state, length, in, out);
diff --git a/src/engine/openssl/bn_powm.cpp b/src/engine/openssl/bn_powm.cpp
index f54411240..7b836d170 100644
--- a/src/engine/openssl/bn_powm.cpp
+++ b/src/engine/openssl/bn_powm.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Modular Exponentiation Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Modular Exponentiation
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -10,9 +12,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL Modular Exponentiator *
-*************************************************/
+/*
+* OpenSSL Modular Exponentiator
+*/
class OpenSSL_Modular_Exponentiator : public Modular_Exponentiator
{
public:
@@ -28,9 +30,9 @@ class OpenSSL_Modular_Exponentiator : public Modular_Exponentiator
OSSL_BN_CTX ctx;
};
-/*************************************************
-* Compute the result *
-*************************************************/
+/*
+* Compute the result
+*/
BigInt OpenSSL_Modular_Exponentiator::execute() const
{
OSSL_BN r;
@@ -40,9 +42,9 @@ BigInt OpenSSL_Modular_Exponentiator::execute() const
}
-/*************************************************
-* Return the OpenSSL-based modular exponentiator *
-*************************************************/
+/*
+* Return the OpenSSL-based modular exponentiator
+*/
Modular_Exponentiator* OpenSSL_Engine::mod_exp(const BigInt& n,
Power_Mod::Usage_Hints) const
{
diff --git a/src/engine/openssl/bn_wrap.cpp b/src/engine/openssl/bn_wrap.cpp
index 4f7ea0078..e1cfe3f95 100644
--- a/src/engine/openssl/bn_wrap.cpp
+++ b/src/engine/openssl/bn_wrap.cpp
@@ -1,15 +1,17 @@
-/*************************************************
-* OpenSSL BN Wrapper Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL BN Wrapper
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/bn_wrap.h>
namespace Botan {
-/*************************************************
-* OSSL_BN Constructor *
-*************************************************/
+/*
+* OSSL_BN Constructor
+*/
OSSL_BN::OSSL_BN(const BigInt& in)
{
value = BN_new();
@@ -18,59 +20,59 @@ OSSL_BN::OSSL_BN(const BigInt& in)
BN_bin2bn(encoding, encoding.size(), value);
}
-/*************************************************
-* OSSL_BN Constructor *
-*************************************************/
+/*
+* OSSL_BN Constructor
+*/
OSSL_BN::OSSL_BN(const byte in[], u32bit length)
{
value = BN_new();
BN_bin2bn(in, length, value);
}
-/*************************************************
-* OSSL_BN Copy Constructor *
-*************************************************/
+/*
+* OSSL_BN Copy Constructor
+*/
OSSL_BN::OSSL_BN(const OSSL_BN& other)
{
value = BN_dup(other.value);
}
-/*************************************************
-* OSSL_BN Destructor *
-*************************************************/
+/*
+* OSSL_BN Destructor
+*/
OSSL_BN::~OSSL_BN()
{
BN_clear_free(value);
}
-/*************************************************
-* OSSL_BN Assignment Operator *
-*************************************************/
+/*
+* OSSL_BN Assignment Operator
+*/
OSSL_BN& OSSL_BN::operator=(const OSSL_BN& other)
{
BN_copy(value, other.value);
return (*this);
}
-/*************************************************
-* Export the BIGNUM as a bytestring *
-*************************************************/
+/*
+* Export the BIGNUM as a bytestring
+*/
void OSSL_BN::encode(byte out[], u32bit length) const
{
BN_bn2bin(value, out + (length - bytes()));
}
-/*************************************************
-* Return the number of significant bytes *
-*************************************************/
+/*
+* Return the number of significant bytes
+*/
u32bit OSSL_BN::bytes() const
{
return BN_num_bytes(value);
}
-/*************************************************
-* OpenSSL to BigInt Conversions *
-*************************************************/
+/*
+* OpenSSL to BigInt Conversions
+*/
BigInt OSSL_BN::to_bigint() const
{
SecureVector<byte> out(bytes());
@@ -78,33 +80,33 @@ BigInt OSSL_BN::to_bigint() const
return BigInt::decode(out);
}
-/*************************************************
-* OSSL_BN_CTX Constructor *
-*************************************************/
+/*
+* OSSL_BN_CTX Constructor
+*/
OSSL_BN_CTX::OSSL_BN_CTX()
{
value = BN_CTX_new();
}
-/*************************************************
-* OSSL_BN_CTX Copy Constructor *
-*************************************************/
+/*
+* OSSL_BN_CTX Copy Constructor
+*/
OSSL_BN_CTX::OSSL_BN_CTX(const OSSL_BN_CTX&)
{
value = BN_CTX_new();
}
-/*************************************************
-* OSSL_BN_CTX Destructor *
-*************************************************/
+/*
+* OSSL_BN_CTX Destructor
+*/
OSSL_BN_CTX::~OSSL_BN_CTX()
{
BN_CTX_free(value);
}
-/*************************************************
-* OSSL_BN_CTX Assignment Operator *
-*************************************************/
+/*
+* OSSL_BN_CTX Assignment Operator
+*/
OSSL_BN_CTX& OSSL_BN_CTX::operator=(const OSSL_BN_CTX&)
{
value = BN_CTX_new();
diff --git a/src/engine/openssl/bn_wrap.h b/src/engine/openssl/bn_wrap.h
index e8464e74e..4d18be1b5 100644
--- a/src/engine/openssl/bn_wrap.h
+++ b/src/engine/openssl/bn_wrap.h
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL BN Wrapper Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL BN Wrapper
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_OPENSSL_BN_WRAP_H__
#define BOTAN_OPENSSL_BN_WRAP_H__
@@ -11,9 +13,9 @@
namespace Botan {
-/*************************************************
-* Lightweight OpenSSL BN Wrapper *
-*************************************************/
+/*
+* Lightweight OpenSSL BN Wrapper
+*/
class BOTAN_DLL OSSL_BN
{
public:
@@ -31,9 +33,9 @@ class BOTAN_DLL OSSL_BN
~OSSL_BN();
};
-/*************************************************
-* Lightweight OpenSSL BN_CTX Wrapper *
-*************************************************/
+/*
+* Lightweight OpenSSL BN_CTX Wrapper
+*/
class BOTAN_DLL OSSL_BN_CTX
{
public:
diff --git a/src/engine/openssl/eng_ossl.h b/src/engine/openssl/eng_ossl.h
index 7f345f0ff..7105546dd 100644
--- a/src/engine/openssl/eng_ossl.h
+++ b/src/engine/openssl/eng_ossl.h
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Engine Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_ENGINE_OPENSSL_H__
#define BOTAN_ENGINE_OPENSSL_H__
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* OpenSSL Engine *
-*************************************************/
+/*
+* OpenSSL Engine
+*/
class BOTAN_DLL OpenSSL_Engine : public Engine
{
public:
diff --git a/src/engine/openssl/ossl_bc.cpp b/src/engine/openssl/ossl_bc.cpp
index 9b9a3c8a7..4d3761adb 100644
--- a/src/engine/openssl/ossl_bc.cpp
+++ b/src/engine/openssl/ossl_bc.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Block Cipher Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Block Cipher
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <openssl/evp.h>
@@ -10,9 +12,9 @@ namespace Botan {
namespace {
-/*************************************************
-* EVP Block Cipher *
-*************************************************/
+/*
+* EVP Block Cipher
+*/
class EVP_BlockCipher : public BlockCipher
{
public:
@@ -32,9 +34,9 @@ class EVP_BlockCipher : public BlockCipher
mutable EVP_CIPHER_CTX encrypt, decrypt;
};
-/*************************************************
-* EVP Block Cipher Constructor *
-*************************************************/
+/*
+* EVP Block Cipher Constructor
+*/
EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo,
const std::string& algo_name) :
BlockCipher(EVP_CIPHER_block_size(algo), EVP_CIPHER_key_length(algo)),
@@ -53,9 +55,9 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo,
EVP_CIPHER_CTX_set_padding(&decrypt, 0);
}
-/*************************************************
-* EVP Block Cipher Constructor *
-*************************************************/
+/*
+* EVP Block Cipher Constructor
+*/
EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo,
const std::string& algo_name,
u32bit key_min, u32bit key_max,
@@ -76,36 +78,36 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* algo,
EVP_CIPHER_CTX_set_padding(&decrypt, 0);
}
-/*************************************************
-* EVP Block Cipher Destructor *
-*************************************************/
+/*
+* EVP Block Cipher Destructor
+*/
EVP_BlockCipher::~EVP_BlockCipher()
{
EVP_CIPHER_CTX_cleanup(&encrypt);
EVP_CIPHER_CTX_cleanup(&decrypt);
}
-/*************************************************
-* Encrypt a block *
-*************************************************/
+/*
+* Encrypt a block
+*/
void EVP_BlockCipher::enc(const byte in[], byte out[]) const
{
int out_len = 0;
EVP_EncryptUpdate(&encrypt, out, &out_len, in, BLOCK_SIZE);
}
-/*************************************************
-* Decrypt a block *
-*************************************************/
+/*
+* Decrypt a block
+*/
void EVP_BlockCipher::dec(const byte in[], byte out[]) const
{
int out_len = 0;
EVP_DecryptUpdate(&decrypt, out, &out_len, in, BLOCK_SIZE);
}
-/*************************************************
-* Set the key *
-*************************************************/
+/*
+* Set the key
+*/
void EVP_BlockCipher::key_schedule(const byte key[], u32bit length)
{
SecureVector<byte> full_key(key, length);
@@ -128,9 +130,9 @@ void EVP_BlockCipher::key_schedule(const byte key[], u32bit length)
EVP_DecryptInit_ex(&decrypt, 0, 0, full_key.begin(), 0);
}
-/*************************************************
-* Return a clone of this object *
-*************************************************/
+/*
+* Return a clone of this object
+*/
BlockCipher* EVP_BlockCipher::clone() const
{
return new EVP_BlockCipher(EVP_CIPHER_CTX_cipher(&encrypt),
@@ -138,9 +140,9 @@ BlockCipher* EVP_BlockCipher::clone() const
MAXIMUM_KEYLENGTH, KEYLENGTH_MULTIPLE);
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void EVP_BlockCipher::clear() throw()
{
const EVP_CIPHER* algo = EVP_CIPHER_CTX_cipher(&encrypt);
@@ -157,9 +159,9 @@ void EVP_BlockCipher::clear() throw()
}
-/*************************************************
-* Look for an algorithm with this name *
-*************************************************/
+/*
+* Look for an algorithm with this name
+*/
BlockCipher*
OpenSSL_Engine::find_block_cipher(const SCAN_Name& request,
Algorithm_Factory&) const
diff --git a/src/engine/openssl/ossl_dh.cpp b/src/engine/openssl/ossl_dh.cpp
index 290b95622..72eab8a48 100644
--- a/src/engine/openssl/ossl_dh.cpp
+++ b/src/engine/openssl/ossl_dh.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Engine Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -17,9 +19,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL DH Operation *
-*************************************************/
+/*
+* OpenSSL DH Operation
+*/
class OpenSSL_DH_Op : public DH_Operation
{
public:
@@ -33,9 +35,9 @@ class OpenSSL_DH_Op : public DH_Operation
OSSL_BN_CTX ctx;
};
-/*************************************************
-* OpenSSL DH Key Agreement Operation *
-*************************************************/
+/*
+* OpenSSL DH Key Agreement Operation
+*/
BigInt OpenSSL_DH_Op::agree(const BigInt& i_bn) const
{
OSSL_BN i(i_bn), r;
@@ -45,9 +47,9 @@ BigInt OpenSSL_DH_Op::agree(const BigInt& i_bn) const
}
-/*************************************************
-* Acquire a DH op *
-*************************************************/
+/*
+* Acquire a DH op
+*/
DH_Operation* OpenSSL_Engine::dh_op(const DL_Group& group,
const BigInt& x) const
{
diff --git a/src/engine/openssl/ossl_dsa.cpp b/src/engine/openssl/ossl_dsa.cpp
index 2757234e2..bfffb8796 100644
--- a/src/engine/openssl/ossl_dsa.cpp
+++ b/src/engine/openssl/ossl_dsa.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL DSA Engine Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL DSA Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -17,9 +19,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL DSA Operation *
-*************************************************/
+/*
+* OpenSSL DSA Operation
+*/
class OpenSSL_DSA_Op : public DSA_Operation
{
public:
@@ -36,9 +38,9 @@ class OpenSSL_DSA_Op : public DSA_Operation
OSSL_BN_CTX ctx;
};
-/*************************************************
-* OpenSSL DSA Verify Operation *
-*************************************************/
+/*
+* OpenSSL DSA Verify Operation
+*/
bool OpenSSL_DSA_Op::verify(const byte msg[], u32bit msg_len,
const byte sig[], u32bit sig_len) const
{
@@ -75,9 +77,9 @@ bool OpenSSL_DSA_Op::verify(const byte msg[], u32bit msg_len,
return false;
}
-/*************************************************
-* OpenSSL DSA Sign Operation *
-*************************************************/
+/*
+* OpenSSL DSA Sign Operation
+*/
SecureVector<byte> OpenSSL_DSA_Op::sign(const byte in[], u32bit length,
const BigInt& k_bn) const
{
@@ -111,9 +113,9 @@ SecureVector<byte> OpenSSL_DSA_Op::sign(const byte in[], u32bit length,
}
-/*************************************************
-* Acquire a DSA op *
-*************************************************/
+/*
+* Acquire a DSA op
+*/
DSA_Operation* OpenSSL_Engine::dsa_op(const DL_Group& group, const BigInt& y,
const BigInt& x) const
{
diff --git a/src/engine/openssl/ossl_elg.cpp b/src/engine/openssl/ossl_elg.cpp
index 25d628ba8..aefda9a1e 100644
--- a/src/engine/openssl/ossl_elg.cpp
+++ b/src/engine/openssl/ossl_elg.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Engine Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -17,9 +19,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL ElGamal Operation *
-*************************************************/
+/*
+* OpenSSL ElGamal Operation
+*/
class OpenSSL_ELG_Op : public ELG_Operation
{
public:
@@ -35,9 +37,9 @@ class OpenSSL_ELG_Op : public ELG_Operation
OSSL_BN_CTX ctx;
};
-/*************************************************
-* OpenSSL ElGamal Encrypt Operation *
-*************************************************/
+/*
+* OpenSSL ElGamal Encrypt Operation
+*/
SecureVector<byte> OpenSSL_ELG_Op::encrypt(const byte in[], u32bit length,
const BigInt& k_bn) const
{
@@ -59,9 +61,9 @@ SecureVector<byte> OpenSSL_ELG_Op::encrypt(const byte in[], u32bit length,
return output;
}
-/*************************************************
-* OpenSSL ElGamal Decrypt Operation *
-*************************************************/
+/*
+* OpenSSL ElGamal Decrypt Operation
+*/
BigInt OpenSSL_ELG_Op::decrypt(const BigInt& a_bn, const BigInt& b_bn) const
{
if(BN_is_zero(x.value))
@@ -80,9 +82,9 @@ BigInt OpenSSL_ELG_Op::decrypt(const BigInt& a_bn, const BigInt& b_bn) const
}
-/*************************************************
-* Acquire an ElGamal op *
-*************************************************/
+/*
+* Acquire an ElGamal op
+*/
ELG_Operation* OpenSSL_Engine::elg_op(const DL_Group& group, const BigInt& y,
const BigInt& x) const
{
diff --git a/src/engine/openssl/ossl_if.cpp b/src/engine/openssl/ossl_if.cpp
index 08a43e63e..bbc10d549 100644
--- a/src/engine/openssl/ossl_if.cpp
+++ b/src/engine/openssl/ossl_if.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL IF Engine Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL IF Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -17,9 +19,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL IF Operation *
-*************************************************/
+/*
+* OpenSSL IF Operation
+*/
class OpenSSL_IF_Op : public IF_Operation
{
public:
@@ -37,9 +39,9 @@ class OpenSSL_IF_Op : public IF_Operation
OSSL_BN_CTX ctx;
};
-/*************************************************
-* OpenSSL IF Public Operation *
-*************************************************/
+/*
+* OpenSSL IF Public Operation
+*/
BigInt OpenSSL_IF_Op::public_op(const BigInt& i_bn) const
{
OSSL_BN i(i_bn), r;
@@ -47,9 +49,9 @@ BigInt OpenSSL_IF_Op::public_op(const BigInt& i_bn) const
return r.to_bigint();
}
-/*************************************************
-* OpenSSL IF Private Operation *
-*************************************************/
+/*
+* OpenSSL IF Private Operation
+*/
BigInt OpenSSL_IF_Op::private_op(const BigInt& i_bn) const
{
if(BN_is_zero(p.value))
@@ -68,9 +70,9 @@ BigInt OpenSSL_IF_Op::private_op(const BigInt& i_bn) const
}
-/*************************************************
-* Acquire an IF op *
-*************************************************/
+/*
+* Acquire an IF op
+*/
IF_Operation* OpenSSL_Engine::if_op(const BigInt& e, const BigInt& n,
const BigInt& d, const BigInt& p,
const BigInt& q, const BigInt& d1,
diff --git a/src/engine/openssl/ossl_md.cpp b/src/engine/openssl/ossl_md.cpp
index 4e28c515e..08672cfc8 100644
--- a/src/engine/openssl/ossl_md.cpp
+++ b/src/engine/openssl/ossl_md.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL Hash Functions Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL Hash Functions
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <openssl/evp.h>
@@ -10,9 +12,9 @@ namespace Botan {
namespace {
-/*************************************************
-* EVP Hash Function *
-*************************************************/
+/*
+* EVP Hash Function
+*/
class EVP_HashFunction : public HashFunction
{
public:
@@ -29,17 +31,17 @@ class EVP_HashFunction : public HashFunction
EVP_MD_CTX md;
};
-/*************************************************
-* Update an EVP Hash Calculation *
-*************************************************/
+/*
+* Update an EVP Hash Calculation
+*/
void EVP_HashFunction::add_data(const byte input[], u32bit length)
{
EVP_DigestUpdate(&md, input, length);
}
-/*************************************************
-* Finalize an EVP Hash Calculation *
-*************************************************/
+/*
+* Finalize an EVP Hash Calculation
+*/
void EVP_HashFunction::final_result(byte output[])
{
EVP_DigestFinal_ex(&md, output, 0);
@@ -47,27 +49,27 @@ void EVP_HashFunction::final_result(byte output[])
EVP_DigestInit_ex(&md, algo, 0);
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void EVP_HashFunction::clear() throw()
{
const EVP_MD* algo = EVP_MD_CTX_md(&md);
EVP_DigestInit_ex(&md, algo, 0);
}
-/*************************************************
-* Return a clone of this object *
-*************************************************/
+/*
+* Return a clone of this object
+*/
HashFunction* EVP_HashFunction::clone() const
{
const EVP_MD* algo = EVP_MD_CTX_md(&md);
return new EVP_HashFunction(algo, name());
}
-/*************************************************
-* Create an EVP hash function *
-*************************************************/
+/*
+* Create an EVP hash function
+*/
EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo,
const std::string& name) :
HashFunction(EVP_MD_size(algo), EVP_MD_block_size(algo)),
@@ -77,9 +79,9 @@ EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo,
EVP_DigestInit_ex(&md, algo, 0);
}
-/*************************************************
-* Destroy an EVP hash function *
-*************************************************/
+/*
+* Destroy an EVP hash function
+*/
EVP_HashFunction::~EVP_HashFunction()
{
EVP_MD_CTX_cleanup(&md);
@@ -87,9 +89,9 @@ EVP_HashFunction::~EVP_HashFunction()
}
-/*************************************************
-* Look for an algorithm with this name *
-*************************************************/
+/*
+* Look for an algorithm with this name
+*/
HashFunction* OpenSSL_Engine::find_hash(const SCAN_Name& request,
Algorithm_Factory&) const
{
diff --git a/src/engine/openssl/ossl_nr.cpp b/src/engine/openssl/ossl_nr.cpp
index 210e2fec2..532e4b8be 100644
--- a/src/engine/openssl/ossl_nr.cpp
+++ b/src/engine/openssl/ossl_nr.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* OpenSSL NR Engine Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* OpenSSL NR Engine
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/eng_ossl.h>
#include <botan/bn_wrap.h>
@@ -17,9 +19,9 @@ namespace Botan {
namespace {
-/*************************************************
-* OpenSSL NR Operation *
-*************************************************/
+/*
+* OpenSSL NR Operation
+*/
class OpenSSL_NR_Op : public NR_Operation
{
public:
@@ -36,9 +38,9 @@ class OpenSSL_NR_Op : public NR_Operation
OSSL_BN_CTX ctx;
};
-/*************************************************
-* OpenSSL NR Verify Operation *
-*************************************************/
+/*
+* OpenSSL NR Verify Operation
+*/
SecureVector<byte> OpenSSL_NR_Op::verify(const byte sig[],
u32bit sig_len) const
{
@@ -63,9 +65,9 @@ SecureVector<byte> OpenSSL_NR_Op::verify(const byte sig[],
return BigInt::encode(i1.to_bigint());
}
-/*************************************************
-* OpenSSL NR Sign Operation *
-*************************************************/
+/*
+* OpenSSL NR Sign Operation
+*/
SecureVector<byte> OpenSSL_NR_Op::sign(const byte in[], u32bit length,
const BigInt& k_bn) const
{
@@ -98,9 +100,9 @@ SecureVector<byte> OpenSSL_NR_Op::sign(const byte in[], u32bit length,
}
-/*************************************************
-* Acquire a NR op *
-*************************************************/
+/*
+* Acquire a NR op
+*/
NR_Operation* OpenSSL_Engine::nr_op(const DL_Group& group, const BigInt& y,
const BigInt& x) const
{