⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mgf1.cpp

📁 含有多种公开密钥算法、多种块加密、多种数据流加密、多种HASH函数、多种CheckSum校验、多种MAC校验等几十种加密算法的程序
💻 CPP
字号:
/************************************************** MGF1 Source File                               ** (C) 1999-2002 The Botan Project                **************************************************/#include <botan/mgf1.h>#include <botan/lookup.h>namespace Botan {/************************************************** MGF1 Mask Generation Function                  **************************************************/void MGF1::mask(const byte in[], u32bit in_len, byte out[],                u32bit out_len) const   {   u32bit counter = 0;   while(out_len)      {      hash->update(in, in_len);      for(u32bit j = 0; j != 4; j++)         hash->update(get_byte(j, counter));      SecureVector<byte> buffer = hash->final();      u32bit xored = std::min(buffer.size(), out_len);      xor_buf(out, buffer, xored);      out += xored;      out_len -= xored;      counter++;      }   }/************************************************** MGF1 Constructor                               **************************************************/MGF1::MGF1(const std::string& hash_name)   {   hash = get_hash(hash_name);   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -