diff options
author | lloyd <[email protected]> | 2008-11-08 19:01:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-08 19:01:32 +0000 |
commit | 5164d043709c1df2b7acd0fe09efe979d23a3e33 (patch) | |
tree | 4ad92bd8148e5dac8af85e338c212f4fd3701f8a /src/core/base.cpp | |
parent | a236130625cec42d3577293cc8eb571c7a8099f4 (diff) |
Move BufferedComputation to new buf_comp.{h,cpp}
Diffstat (limited to 'src/core/base.cpp')
-rw-r--r-- | src/core/base.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/core/base.cpp b/src/core/base.cpp index 4fdf9562d..ede199685 100644 --- a/src/core/base.cpp +++ b/src/core/base.cpp @@ -69,13 +69,6 @@ StreamCipher::StreamCipher(u32bit key_min, u32bit key_max, u32bit key_mod, } /************************************************* -* BufferedComputation Constructor * -*************************************************/ -BufferedComputation::BufferedComputation(u32bit olen) : OUTPUT_LENGTH(olen) - { - } - -/************************************************* * Default StreamCipher Resync Operation * *************************************************/ void StreamCipher::resync(const byte[], u32bit length) @@ -93,73 +86,4 @@ void StreamCipher::seek(u32bit) throw Exception("The stream cipher " + name() + " does not support seek()"); } -/************************************************* -* Hashing/MACing * -*************************************************/ -void BufferedComputation::update(const byte in[], u32bit n) - { - add_data(in, n); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -void BufferedComputation::update(const MemoryRegion<byte>& in) - { - add_data(in, in.size()); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -void BufferedComputation::update(const std::string& str) - { - update(reinterpret_cast<const byte*>(str.data()), str.size()); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -void BufferedComputation::update(byte in) - { - update(&in, 1); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -SecureVector<byte> BufferedComputation::final() - { - SecureVector<byte> output(OUTPUT_LENGTH); - final_result(output); - return output; - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -SecureVector<byte> BufferedComputation::process(const byte in[], u32bit len) - { - update(in, len); - return final(); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -SecureVector<byte> BufferedComputation::process(const MemoryRegion<byte>& in) - { - update(in, in.size()); - return final(); - } - -/************************************************* -* Hashing/MACing * -*************************************************/ -SecureVector<byte> BufferedComputation::process(const std::string& in) - { - update(in); - return final(); - } - } |