summaryrefslogtreecommitdiff
path: root/gf2n.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-04 00:17:37 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-04 00:17:37 +0000
commit572fe07633123ce38abf28c6426356e37aef3a99 (patch)
tree0536d87e504a82920156c239bc5ae6aa43e70ebc /gf2n.cpp
parent3e8c979ddc194e043567c036321e67c89f847362 (diff)
downloadcryptopp-572fe07633123ce38abf28c6426356e37aef3a99.tar.gz
create DLL version, fix GetNextIV() bug in CTR and OFB modes
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@87 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'gf2n.cpp')
-rw-r--r--gf2n.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/gf2n.cpp b/gf2n.cpp
index 3043075..b7b4bf9 100644
--- a/gf2n.cpp
+++ b/gf2n.cpp
@@ -1,17 +1,18 @@
// gf2n.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
+
+#ifndef CRYPTOPP_IMPORTS
+
#include "gf2n.h"
#include "algebra.h"
#include "words.h"
-#include "rng.h"
+#include "randpool.h"
#include "asn.h"
#include "oids.h"
#include <iostream>
-#include "algebra.cpp"
-
NAMESPACE_BEGIN(CryptoPP)
PolynomialMod2::PolynomialMod2()
@@ -551,10 +552,10 @@ GF2NP::Element GF2NP::SolveQuadraticEquation(const Element &a) const
if (m%2 == 0)
{
Element z, w;
+ RandomPool rng;
do
{
- LC_RNG rng(11111);
- Element p(rng, m);
+ Element p((RandomNumberGenerator &)rng, m);
z = PolynomialMod2::Zero();
w = p;
for (unsigned int i=1; i<=m-1; i++)
@@ -868,3 +869,5 @@ GF2NP * BERDecodeGF2NP(BufferedTransformation &bt)
}
NAMESPACE_END
+
+#endif