Commit 9f6ae485 authored by yiwenshao's avatar yiwenshao

add two maps string_to_onion and string_to_seclevel in util/onions.cc

parent dcdbd150
#include "util/onions.hh"
std::map<std::string,onion> string_to_onion{
{"oDET",oDET},
{"oOPE",oOPE},
{"oAGG",oAGG},
{"oSWP",oSWP},
{"oPLAIN",oPLAIN},
{"oBESTEFFORT",oBESTEFFORT},
{"oASHE",oASHE},
{"oINVALID",oINVALID}
};
std::map<std::string,SECLEVEL> string_to_seclevel={
{"INVALID",SECLEVEL::INVALID},
{"PLAINVAL",SECLEVEL::PLAINVAL},
{"OPEFOREIGN",SECLEVEL::OPEFOREIGN},
{"OPE",SECLEVEL::OPE},
{"DETJOIN",SECLEVEL::DETJOIN},
{"DET",SECLEVEL::DET},
{"SEARCH",SECLEVEL::SEARCH},
{"HOM",SECLEVEL::HOM},
{"ASHE",SECLEVEL::ASHE},
{"RND",SECLEVEL::RND}
};
...@@ -18,6 +18,8 @@ typedef enum onion { ...@@ -18,6 +18,8 @@ typedef enum onion {
oINVALID, oINVALID,
} onion; } onion;
extern std::map<std::string,onion> string_to_onion;
//Sec levels ordered such that //Sec levels ordered such that
// if a is less secure than b. // if a is less secure than b.
// a appears before b // a appears before b
...@@ -36,6 +38,9 @@ enum class SECLEVEL { ...@@ -36,6 +38,9 @@ enum class SECLEVEL {
RND, RND,
}; };
extern std::map<std::string,SECLEVEL> string_to_seclevel;
//Onion layouts - initial structure of onions //Onion layouts - initial structure of onions
typedef std::map<onion, std::vector<SECLEVEL> > onionlayout; typedef std::map<onion, std::vector<SECLEVEL> > onionlayout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment