From a85f136550c08fc878e3983866af0e6460e980da Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 12 Oct 2010 19:51:32 +0000 Subject: Use size_t in filters This breaks API for anyone creating their own Filter types, but it had to happen eventually. --- checks/block.cpp | 4 ++-- checks/dolook.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'checks') diff --git a/checks/block.cpp b/checks/block.cpp index e3b871aa1..dc3350ce3 100644 --- a/checks/block.cpp +++ b/checks/block.cpp @@ -27,7 +27,7 @@ class ECB_Encryption_ErrorCheck : public Filter std::string name() const { return "ECB_ErrCheck(" + cipher->name() + ")"; } - void write(const byte[], u32bit); + void write(const byte[], size_t); void end_msg(); @@ -61,7 +61,7 @@ class ECB_Encryption_ErrorCheck : public Filter HashFunction* input_hash, *decrypt_hash; }; -void ECB_Encryption_ErrorCheck::write(const byte input[], u32bit length) +void ECB_Encryption_ErrorCheck::write(const byte input[], size_t length) { input_hash->update(input, length); buffer.copy(position, input, length); diff --git a/checks/dolook.cpp b/checks/dolook.cpp index a20268332..1015f4240 100644 --- a/checks/dolook.cpp +++ b/checks/dolook.cpp @@ -65,7 +65,7 @@ class PBKDF_Filter : public Filter public: std::string name() const { return pbkdf->name(); } - void write(const byte in[], u32bit len) + void write(const byte in[], size_t len) { passphrase += std::string(reinterpret_cast(in), len); } void end_msg() @@ -98,7 +98,7 @@ class RNG_Filter : public Filter public: std::string name() const { return rng->name(); } - void write(const byte[], u32bit); + void write(const byte[], size_t); RNG_Filter(RandomNumberGenerator* r) : rng(r) {} ~RNG_Filter() { delete rng; } @@ -111,7 +111,7 @@ class KDF_Filter : public Filter public: std::string name() const { return "KDF_Filter"; } - void write(const byte in[], u32bit len) + void write(const byte in[], size_t len) { secret += std::make_pair(in, len); } void end_msg() @@ -150,7 +150,7 @@ Filter* lookup_pbkdf(const std::string& algname, return 0; } -void RNG_Filter::write(const byte[], u32bit length) +void RNG_Filter::write(const byte[], size_t length) { if(length) { -- cgit v1.2.3