aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/blowfish
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/blowfish')
-rw-r--r--src/block/blowfish/blowfish.cpp6
-rw-r--r--src/block/blowfish/blowfish.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/block/blowfish/blowfish.cpp b/src/block/blowfish/blowfish.cpp
index 6e4ad5b28..91d25884d 100644
--- a/src/block/blowfish/blowfish.cpp
+++ b/src/block/blowfish/blowfish.cpp
@@ -131,8 +131,10 @@ void Blowfish::generate_sbox(MemoryRegion<u32bit>& box,
*/
void Blowfish::clear()
{
- P.copy(P_INIT, 18);
- S.copy(S_INIT, 1024);
+ std::copy(P_INIT, P_INIT + 18, P.begin());
+ std::copy(S_INIT, S_INIT + 1024, S.begin());
+ //P.copy(P_INIT, 18);
+ //S.copy(S_INIT, 1024);
}
}
diff --git a/src/block/blowfish/blowfish.h b/src/block/blowfish/blowfish.h
index 88122aed8..0b4df50ad 100644
--- a/src/block/blowfish/blowfish.h
+++ b/src/block/blowfish/blowfish.h
@@ -25,7 +25,7 @@ class BOTAN_DLL Blowfish : public BlockCipher
std::string name() const { return "Blowfish"; }
BlockCipher* clone() const { return new Blowfish; }
- Blowfish() : BlockCipher(8, 1, 56) {}
+ Blowfish() : BlockCipher(8, 1, 56), S(1024), P(18) {}
private:
void key_schedule(const byte[], u32bit);
void generate_sbox(MemoryRegion<u32bit>& box,
@@ -34,8 +34,8 @@ class BOTAN_DLL Blowfish : public BlockCipher
static const u32bit P_INIT[18];
static const u32bit S_INIT[1024];
- SecureVector<u32bit, 1024> S;
- SecureVector<u32bit, 18> P;
+ SecureVector<u32bit> S;
+ SecureVector<u32bit> P;
};
}