summaryrefslogtreecommitdiff
path: root/gf256.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
commit48809d4e85c125814425c621d8d0d89f95405924 (patch)
tree1010fd16c4b1199f3d27dd726dda241a2bd29f83 /gf256.h
parent025337a94aceb75d188149db70c2094673772816 (diff)
downloadcryptopp-git-48809d4e85c125814425c621d8d0d89f95405924.tar.gz
CRYPTOPP 5.6.3 RC6 checkin
Diffstat (limited to 'gf256.h')
-rw-r--r--gf256.h134
1 files changed, 67 insertions, 67 deletions
diff --git a/gf256.h b/gf256.h
index e50cf6d9..47f35e4c 100644
--- a/gf256.h
+++ b/gf256.h
@@ -1,67 +1,67 @@
-#ifndef CRYPTOPP_GF256_H
-#define CRYPTOPP_GF256_H
-
-#include "cryptlib.h"
-#include "misc.h"
-
-NAMESPACE_BEGIN(CryptoPP)
-
-//! GF(256) with polynomial basis
-class GF256
-{
-public:
- typedef byte Element;
- typedef int RandomizationParameter;
-
- GF256(byte modulus) : m_modulus(modulus) {}
-
- Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const
- {CRYPTOPP_UNUSED(ignored);return rng.GenerateByte();}
-
- bool Equal(Element a, Element b) const
- {return a==b;}
-
- Element Zero() const
- {return 0;}
-
- Element Add(Element a, Element b) const
- {return a^b;}
-
- Element& Accumulate(Element &a, Element b) const
- {return a^=b;}
-
- Element Inverse(Element a) const
- {return a;}
-
- Element Subtract(Element a, Element b) const
- {return a^b;}
-
- Element& Reduce(Element &a, Element b) const
- {return a^=b;}
-
- Element Double(Element a) const
- {CRYPTOPP_UNUSED(a);return 0;}
-
- Element One() const
- {return 1;}
-
- Element Multiply(Element a, Element b) const;
-
- Element Square(Element a) const
- {return Multiply(a, a);}
-
- bool IsUnit(Element a) const
- {return a != 0;}
-
- Element MultiplicativeInverse(Element a) const;
-
- Element Divide(Element a, Element b) const
- {return Multiply(a, MultiplicativeInverse(b));}
-
-private:
- word m_modulus;
-};
-
-NAMESPACE_END
-
-#endif
+#ifndef CRYPTOPP_GF256_H
+#define CRYPTOPP_GF256_H
+
+#include "cryptlib.h"
+#include "misc.h"
+
+NAMESPACE_BEGIN(CryptoPP)
+
+//! GF(256) with polynomial basis
+class GF256
+{
+public:
+ typedef byte Element;
+ typedef int RandomizationParameter;
+
+ GF256(byte modulus) : m_modulus(modulus) {}
+
+ Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const
+ {CRYPTOPP_UNUSED(ignored); return rng.GenerateByte();}
+
+ bool Equal(Element a, Element b) const
+ {return a==b;}
+
+ Element Zero() const
+ {return 0;}
+
+ Element Add(Element a, Element b) const
+ {return a^b;}
+
+ Element& Accumulate(Element &a, Element b) const
+ {return a^=b;}
+
+ Element Inverse(Element a) const
+ {return a;}
+
+ Element Subtract(Element a, Element b) const
+ {return a^b;}
+
+ Element& Reduce(Element &a, Element b) const
+ {return a^=b;}
+
+ Element Double(Element a) const
+ {CRYPTOPP_UNUSED(a); return 0;}
+
+ Element One() const
+ {return 1;}
+
+ Element Multiply(Element a, Element b) const;
+
+ Element Square(Element a) const
+ {return Multiply(a, a);}
+
+ bool IsUnit(Element a) const
+ {return a != 0;}
+
+ Element MultiplicativeInverse(Element a) const;
+
+ Element Divide(Element a, Element b) const
+ {return Multiply(a, MultiplicativeInverse(b));}
+
+private:
+ word m_modulus;
+};
+
+NAMESPACE_END
+
+#endif