aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/algo_factory/algo_cache.h5
-rw-r--r--src/hash/gost_3411/gost_3411.cpp2
-rw-r--r--src/hash/gost_3411/gost_3411.h2
-rw-r--r--src/hash/sha1_sse2/sha1_sse2_imp.cpp29
-rw-r--r--src/math/gfpmath/curve_gfp.cpp10
-rw-r--r--src/math/gfpmath/gfp_element.cpp23
-rw-r--r--src/math/gfpmath/gfp_element.h60
-rw-r--r--src/math/gfpmath/gfp_modulus.h47
-rw-r--r--src/math/gfpmath/point_gfp.cpp15
-rw-r--r--src/math/gfpmath/point_gfp.h8
-rw-r--r--src/pubkey/ec_dompar/ec_dompar.cpp8
-rw-r--r--src/pubkey/ec_dompar/ec_dompar.h3
12 files changed, 106 insertions, 106 deletions
diff --git a/src/algo_factory/algo_cache.h b/src/algo_factory/algo_cache.h
index 17ea9964a..08b25cd47 100644
--- a/src/algo_factory/algo_cache.h
+++ b/src/algo_factory/algo_cache.h
@@ -1,5 +1,8 @@
-/**
+/*
* An algorithm cache (used by Algorithm_Factory)
+* (C) 2008-2009 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_ALGORITHM_CACHE_TEMPLATE_H__
diff --git a/src/hash/gost_3411/gost_3411.cpp b/src/hash/gost_3411/gost_3411.cpp
index 3c7f5f92b..8f3982fca 100644
--- a/src/hash/gost_3411/gost_3411.cpp
+++ b/src/hash/gost_3411/gost_3411.cpp
@@ -1,6 +1,8 @@
/*
* GOST 34.11
* (C) 2009 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
*/
#include <botan/gost_3411.h>
diff --git a/src/hash/gost_3411/gost_3411.h b/src/hash/gost_3411/gost_3411.h
index c69555052..960adaa44 100644
--- a/src/hash/gost_3411/gost_3411.h
+++ b/src/hash/gost_3411/gost_3411.h
@@ -1,6 +1,8 @@
/**
* GOST 34.11
* (C) 2009 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_GOST_3411_H__
diff --git a/src/hash/sha1_sse2/sha1_sse2_imp.cpp b/src/hash/sha1_sse2/sha1_sse2_imp.cpp
index 57b287bdb..5ee222cca 100644
--- a/src/hash/sha1_sse2/sha1_sse2_imp.cpp
+++ b/src/hash/sha1_sse2/sha1_sse2_imp.cpp
@@ -1,25 +1,14 @@
-/* this code is public domain.
-
- * dean gaudet <[email protected]>
-
- * this code was inspired by this paper:
-
- * SHA: A Design for Parallel Architectures?
- * Antoon Bosselaers, Ren�e Govaerts and Joos Vandewalle
- * <http://www.esat.kuleuven.ac.be/~cosicart/pdf/AB-9700.pdf>
-
- * more information available on this implementation here:
-
- * http://arctic.org/~dean/crypto/sha1.html
-
- * version: 2
- */
-
/*
- * Lightly modified for Botan, tested under GCC 4.1.1 and ICC 9.1
- * on a Linux/Core2 system.
+* SHA-1 using SSE2
+* (C) 2009 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
- */
+/*
+* Based on public domain code by Dean Gaudet <[email protected]>
+* http://arctic.org/~dean/crypto/sha1.html
+*/
#include <botan/sha1_sse2.h>
#include <botan/rotate.h>
diff --git a/src/math/gfpmath/curve_gfp.cpp b/src/math/gfpmath/curve_gfp.cpp
index e12ade081..9a3ffd482 100644
--- a/src/math/gfpmath/curve_gfp.cpp
+++ b/src/math/gfpmath/curve_gfp.cpp
@@ -1,11 +1,11 @@
-/******
+/*
* Elliptic curves over GF(p)
*
-* (C) 2007 Martin Doering
-* Christoph Ludwig
-* Falko Strenzke
+* (C) 2007 Martin Doering, Christoph Ludwig, Falko Strenzke
* 2008 Jack Lloyd
-******/
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/curve_gfp.h>
#include <botan/bigint.h>
diff --git a/src/math/gfpmath/gfp_element.cpp b/src/math/gfpmath/gfp_element.cpp
index b71809301..23887929a 100644
--- a/src/math/gfpmath/gfp_element.cpp
+++ b/src/math/gfpmath/gfp_element.cpp
@@ -1,13 +1,15 @@
-/******
- * Arithmetic for prime fields GF(p) (source file)
- *
- * (C) 2007 Martin Doering
- * Christoph Ludwig
- * Falko Strenzke
- ******/
+/*
+* Arithmetic for prime fields GF(p)
+*
+* (C) 2007 Martin Doering
+* Christoph Ludwig
+* Falko Strenzke
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/gfp_element.h>
#include <botan/numthry.h>
@@ -15,7 +17,6 @@
#include <botan/mp_types.h>
#include <botan/mp_asm.h>
#include <botan/mp_asmi.h>
-#include <assert.h>
#include <ostream>
namespace Botan {
diff --git a/src/math/gfpmath/gfp_element.h b/src/math/gfpmath/gfp_element.h
index 4e0ee985b..18d9e51f9 100644
--- a/src/math/gfpmath/gfp_element.h
+++ b/src/math/gfpmath/gfp_element.h
@@ -1,13 +1,15 @@
-/******
- * Arithmetic for prime fields GF(p) (header file)
- *
- * (C) 2007 Martin Doering
- * Christoph Ludwig
- * Falko Strenzke
- ******/
+/*
+* Arithmetic for prime fields GF(p)
+*
+* (C) 2007 Martin Doering
+* Christoph Ludwig
+* Falko Strenzke
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_GFP_ELEMENT_H__
#define BOTAN_GFP_ELEMENT_H__
@@ -26,11 +28,11 @@
namespace Botan {
-struct Illegal_Transformation : public Exception
+struct BOTAN_DLL Illegal_Transformation : public Exception
{
Illegal_Transformation(const std::string& err =
- "Requested transformation is not possible")
- : Exception(err) {}
+ "Requested transformation is not possible") :
+ Exception(err) {}
};
/**
@@ -39,23 +41,6 @@ struct Illegal_Transformation : public Exception
*/
class BOTAN_DLL GFpElement
{
- private:
- std::tr1::shared_ptr<GFpModulus> mp_mod;
- mutable BigInt m_value; // ordinary residue or m-residue respectively
- mutable BigInt workspace;
-
- // *****************************************
- // data members for montgomery multiplication
- mutable bool m_use_montgm;
- //mutable BigInt m_mres;
- // this bool tells use whether the m_mres carries
- // the actual value (in this case mValue doesn´t)
- mutable bool m_is_trf;
-
- void ensure_montgm_precomp() const;
- void trf_to_mres() const;
- void trf_to_ordres() const;
-
public:
/** construct an element of GF(p) with the given value.
@@ -260,7 +245,22 @@ class BOTAN_DLL GFpElement
* @param other The value to swap with
*/
void swap(GFpElement& other);
+ private:
+ void ensure_montgm_precomp() const;
+ void trf_to_mres() const;
+ void trf_to_ordres() const;
+
+ std::tr1::shared_ptr<GFpModulus> mp_mod;
+ mutable BigInt m_value; // ordinary residue or m-residue respectively
+ mutable BigInt workspace;
+ // *****************************************
+ // data members for montgomery multiplication
+ mutable bool m_use_montgm;
+ //mutable BigInt m_mres;
+ // this bool tells use whether the m_mres carries
+ // the actual value (in this case mValue doesn´t)
+ mutable bool m_is_trf;
};
// relational operators
diff --git a/src/math/gfpmath/gfp_modulus.h b/src/math/gfpmath/gfp_modulus.h
index b5c085775..8e37e9a73 100644
--- a/src/math/gfpmath/gfp_modulus.h
+++ b/src/math/gfpmath/gfp_modulus.h
@@ -1,39 +1,33 @@
-/******
- * Modulus and related data for a specific
- * implementation of GF(p) (header file)
- *
- * (C) 2008 Martin Döring
- * Christoph Ludwig
- * Falko Strenzke
- ******/
+/*
+* Modulus and related data for a specific implementation of GF(p)
+*
+* (C) 2008 Martin Döring
+* Christoph Ludwig
+* Falko Strenzke
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_GFP_MODULUS_H__
#define BOTAN_GFP_MODULUS_H__
#include <botan/bigint.h>
-namespace Botan
-{
+namespace Botan {
class BOTAN_DLL GFpElement;
+
/**
-* This class represents a GFpElement modulus including the modulus related
-* values necessary for the montgomery multiplication.
-*
-* Distributed under the terms of the Botan license
+* This class represents a GFpElement modulus including the modulus
+* related values necessary for the montgomery multiplication.
*/
class BOTAN_DLL GFpModulus
{
- friend class GFpElement;
- private:
- BigInt m_p; // the modulus itself
- mutable BigInt m_p_dash;
- mutable BigInt m_r;
- mutable BigInt m_r_inv;
public:
+ friend class GFpElement;
/**
* Construct a GF(P)-Modulus from a BigInt
@@ -119,9 +113,14 @@ class BOTAN_DLL GFpModulus
return m_p_dash;
}
// default cp-ctor, op= are fine
+
+ private:
+ BigInt m_p; // the modulus itself
+ mutable BigInt m_p_dash;
+ mutable BigInt m_r;
+ mutable BigInt m_r_inv;
};
}
#endif
-
diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp
index 9139c3ef9..b67631f7b 100644
--- a/src/math/gfpmath/point_gfp.cpp
+++ b/src/math/gfpmath/point_gfp.cpp
@@ -1,12 +1,11 @@
-/******
-* Arithmetic for point groups of elliptic curves
-* over GF(p) (source file)
+/*
+* Arithmetic for point groups of elliptic curves over GF(p)
*
-* (C) 2007 Martin Doering
-* Christoph Ludwig
-* Falko Strenzke
+* (C) 2007 Martin Doering, Christoph Ludwig, Falko Strenzke
* 2008 Jack Lloyd
-******/
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/point_gfp.h>
#include <botan/numthry.h>
@@ -688,8 +687,6 @@ void PointGFp::turn_on_sp_red_mul() const
* returns a point equivalent to *this but were
* Z has value one, i.e. x and y correspond to
* their values in affine coordinates
-*
-* Distributed under the terms of the Botan license
*/
PointGFp const PointGFp::get_z_to_one() const
{
diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h
index 771605efc..62b3bc7da 100644
--- a/src/math/gfpmath/point_gfp.h
+++ b/src/math/gfpmath/point_gfp.h
@@ -1,10 +1,8 @@
/*
-* Arithmetic over GF(p)
+* Arithmetic for point groups of elliptic curves over GF(p)
*
-* (C) 2007 Martin Doering
-* Christoph Ludwig
-* Falko Strenzke
-* (C) 2008 Jack Lloyd
+* (C) 2007 Martin Doering, Christoph Ludwig, Falko Strenzke
+* 2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
diff --git a/src/pubkey/ec_dompar/ec_dompar.cpp b/src/pubkey/ec_dompar/ec_dompar.cpp
index 6cfcc0619..0b5a6e681 100644
--- a/src/pubkey/ec_dompar/ec_dompar.cpp
+++ b/src/pubkey/ec_dompar/ec_dompar.cpp
@@ -1,3 +1,11 @@
+/*
+* ECC Domain Parameters
+*
+* (C) 2007 Falko Strenzke, FlexSecure GmbH
+* 2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/ec_dompar.h>
#include <botan/pubkey_enums.h>
diff --git a/src/pubkey/ec_dompar/ec_dompar.h b/src/pubkey/ec_dompar/ec_dompar.h
index 47971d802..5ea599c9d 100644
--- a/src/pubkey/ec_dompar/ec_dompar.h
+++ b/src/pubkey/ec_dompar/ec_dompar.h
@@ -1,5 +1,6 @@
/*
-* ECDSA Domain Parameters
+* ECC Domain Parameters
+*
* (C) 2007 Falko Strenzke, FlexSecure GmbH
* 2008 Jack Lloyd
*