📄 dl_get.cpp
字号:
/************************************************** 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -