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.h | |
parent | a236130625cec42d3577293cc8eb571c7a8099f4 (diff) |
Move BufferedComputation to new buf_comp.{h,cpp}
Diffstat (limited to 'src/core/base.h')
-rw-r--r-- | src/core/base.h | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/core/base.h b/src/core/base.h index 64186f903..b9be665b1 100644 --- a/src/core/base.h +++ b/src/core/base.h @@ -209,95 +209,6 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm virtual void cipher(const byte[], byte[], u32bit) = 0; }; -/** -* This class represents any kind of computation which -* uses an internal state, -* such as hash functions. -*/ -class BOTAN_DLL BufferedComputation - { - public: - - /** - * The length of the output of this function in bytes. - */ - const u32bit OUTPUT_LENGTH; - - /** - * Add new input to process. - * @param in the input to process as a byte array - * @param the length of the byte array - */ - void update(const byte in[], u32bit length); - - /** - * Add new input to process. - * @param in the input to process as a MemoryRegion - */ - void update(const MemoryRegion<byte>& in); - - /** - * Add new input to process. - * @param in the input to process as a std::string. Will be interpreted - * as a byte array based on - * the strings encoding. - */ - void update(const std::string&); - - /** - * Process a single byte. - * @param in the byte to process - */ - void update(byte in); - - /** - * Complete the computation and retrieve the - * final result. - * @param out The byte array to be filled with the result. - * Must be of length OUTPUT_LENGTH. - */ - void final(byte out[]) { final_result(out); } - - /** - * Complete the computation and retrieve the - * final result. - * @return a SecureVector holding the result - */ - SecureVector<byte> final(); - - /** - * Update and finalize computation. Does the same as calling update() - * and final() consecutively. - * @param in the input to process as a byte array - * @param length the length of the byte array - * @result the result of the call to final() - */ - SecureVector<byte> process(const byte in[], u32bit length); - - /** - * Update and finalize computation. Does the same as calling update() - * and final() consecutively. - * @param in the input to process - * @result the result of the call to final() - */ - SecureVector<byte> process(const MemoryRegion<byte>& in); - - /** - * Update and finalize computation. Does the same as calling update() - * and final() consecutively. - * @param in the input to process as a string - * @result the result of the call to final() - */ - SecureVector<byte> process(const std::string& in); - - BufferedComputation(u32bit); - virtual ~BufferedComputation() {} - private: - BufferedComputation& operator=(const BufferedComputation&); - virtual void add_data(const byte[], u32bit) = 0; - virtual void final_result(byte[]) = 0; - }; - } #endif |