📄 mdx_hash.cpp
字号:
/************************************************** MDx Hash Function Source File ** (C) 1999-2002 The Botan Project **************************************************/#include <botan/mdx_hash.h>namespace Botan {/************************************************** MDx_HashFunction Constructor **************************************************/MDx_HashFunction::MDx_HashFunction(u32bit hash_len, u32bit block_len) : HashFunction(hash_len, block_len), buffer(block_len) { count = position = 0; }/************************************************** Update the hash **************************************************/void MDx_HashFunction::add_data(const byte input[], u32bit length) { count += length; buffer.copy(position, input, length); if(position + length >= HASH_BLOCK_SIZE) { hash(buffer); input += (HASH_BLOCK_SIZE - position); length -= (HASH_BLOCK_SIZE - position); while(length >= HASH_BLOCK_SIZE) { hash(input); input += HASH_BLOCK_SIZE; length -= HASH_BLOCK_SIZE; } buffer.copy(input, length); position = 0; } position += length; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -