use crate::serialization::types::TypeCode;
use super::sfunc::SFunc;
use super::smethod::MethodId;
use super::smethod::SMethodDesc;
use super::stype::SType;
use crate::types::smethod::SMethod;
use crate::types::stype_companion::STypeCompanion;
use lazy_static::lazy_static;
pub const TYPE_CODE: TypeCode = TypeCode::SGLOBAL;
pub static TYPE_NAME: &str = "Global";
pub const GROUP_GENERATOR_METHOD_ID: MethodId = MethodId(1);
pub const XOR_METHOD_ID: MethodId = MethodId(2);
lazy_static! {
pub(crate) static ref METHOD_DESC: Vec<&'static SMethodDesc> =
vec![&GROUP_GENERATOR_METHOD_DESC, &XOR_METHOD_DESC,];
}
lazy_static! {
static ref GROUP_GENERATOR_METHOD_DESC: SMethodDesc = SMethodDesc {
method_id: GROUP_GENERATOR_METHOD_ID,
name: "groupGenerator",
tpe: SFunc {
t_dom: vec![SType::SGlobal],
t_range: SType::SGroupElement.into(),
tpe_params: vec![],
},
};
pub static ref GROUP_GENERATOR_METHOD: SMethod = SMethod::new(STypeCompanion::Global, GROUP_GENERATOR_METHOD_DESC.clone(),);
}
lazy_static! {
static ref XOR_METHOD_DESC: SMethodDesc = SMethodDesc {
method_id: XOR_METHOD_ID,
name: "xor",
tpe: SFunc {
t_dom: vec![
SType::SGlobal,
SType::SColl(SType::SByte.into()),
SType::SColl(SType::SByte.into()),
],
t_range: SType::SColl(SType::SByte.into()).into(),
tpe_params: vec![],
},
};
pub static ref XOR_METHOD: SMethod = SMethod::new(STypeCompanion::Global, XOR_METHOD_DESC.clone(),);
}