dl_get.cpp

来自「含有多种公开密钥算法、多种块加密、多种数据流加密、多种HASH函数、多种Chec」· C++ 代码 · 共 61 行

CPP
61
字号
/************************************************** DL Group Lookup Source File                    ** (C) 1999-2002 The Botan Project                **************************************************/#include <botan/dl_parm.h>#include <map>namespace Botan {namespace {/************************************************** Name to group mapping table                    **************************************************/std::map<std::string, DL_Group> dl_groups;}/************************************************** Try to obtain a particular DL group            **************************************************/extern DL_Group try_to_get_dl_group(const std::string&);/************************************************** Retrieve a DL group by name                    **************************************************/const DL_Group& get_dl_group(const std::string& name)   {   std::map<std::string, DL_Group>::const_iterator group;   group = dl_groups.find(name);   if(group != dl_groups.end())      return group->second;   add_dl_group(name, try_to_get_dl_group(name));   group = dl_groups.find(name);   if(group != dl_groups.end())      return group->second;   throw Exception("Discrete Logarithm group \"" + name + "\" not found");   }/************************************************** Register a named DL group                      **************************************************/void add_dl_group(const std::string& name, const DL_Group& group)   {   dl_groups.insert(std::make_pair(name, group));   }/************************************************** Destroy the table                              **************************************************/void destroy_dl_groups()   {   dl_groups.clear();   }}

⌨️ 快捷键说明

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