mdx_hash.cpp
来自「含有多种公开密钥算法、多种块加密、多种数据流加密、多种HASH函数、多种Chec」· C++ 代码 · 共 44 行
CPP
44 行
/************************************************** 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 + =
减小字号Ctrl + -
显示快捷键?