diff options
author | lloyd <[email protected]> | 2010-10-13 14:58:58 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 14:58:58 +0000 |
commit | 6e85766cf001183e160c8ca2c0ed3eb40f07125c (patch) | |
tree | df11b301786829bc2f6f545038ec97c2269154d9 /src/utils | |
parent | fcd3aba1ff6b8597b31165474573dbb339479c14 (diff) | |
parent | bb53c6169463a67cc751625cb0a2c47df129a2ab (diff) |
propagate from branch 'net.randombit.botan' (head 6581b789d58717bc6acee5c6a248e2d44c636e40)
to branch 'net.randombit.botan.c++0x' (head 227a989ae94da8f4379ea4b9b0fc0ee8dbdde0c7)
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/buf_comp/buf_comp.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/utils/buf_comp/buf_comp.h b/src/utils/buf_comp/buf_comp.h index a64d807dd..0b0ef6e16 100644 --- a/src/utils/buf_comp/buf_comp.h +++ b/src/utils/buf_comp/buf_comp.h @@ -14,9 +14,8 @@ namespace Botan { /** -* This class represents any kind of computation which -* uses an internal state, -* such as hash functions. +* This class represents any kind of computation which uses an internal +* state, such as hash functions or MACs */ class BOTAN_DLL BufferedComputation { @@ -48,9 +47,13 @@ class BOTAN_DLL BufferedComputation add_data(&in[0], in.size()); } - template<typename T> void update_be(const T in, size_t upto = sizeof(T)) + /** + * Add an integer in big-endian order + * @param in the value + */ + template<typename T> void update_be(const T in) { - for(size_t i = 0; i != std::min(upto, sizeof(T)); ++i) + for(size_t i = 0; i != sizeof(T); ++i) { byte b = get_byte(i, in); add_data(&b, 1); |