void RandomNumberStore::StoreInitialize(const NameValuePairs ¶meters) { parameters.GetRequiredParameter("RandomNumberStore", "RandomNumberGeneratorPointer", m_rng); int length; parameters.GetRequiredIntParameter("RandomNumberStore", "RandomNumberStoreSize", length); m_length = length; }
void BaseN_Encoder::IsolatedInitialize(const NameValuePairs ¶meters) { parameters.GetRequiredParameter("BaseN_Encoder", "EncodingLookupArray", m_alphabet); parameters.GetRequiredIntParameter("BaseN_Encoder", "Log2Base", m_bitsPerChar); if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) throw InvalidArgument("BaseN_Encoder: Log2Base must be between 1 and 7 inclusive"); byte padding; bool pad; if (parameters.GetValue("PaddingByte", padding)) pad = parameters.GetValueWithDefault("Pad", true); else pad = false; m_padding = pad ? padding : -1; m_bytePos = m_bitPos = 0; int i = 8; while (i%m_bitsPerChar != 0) i += 8; m_outputBlockSize = i/m_bitsPerChar; m_outBuf.New(m_outputBlockSize); }
void DL_GroupParameters_EC<EC>::AssignFrom(const NameValuePairs &source) { OID oid; if (source.GetValue(Name::GroupOID(), oid)) Initialize(oid); else { EllipticCurve ec; Point G; Integer n; source.GetRequiredParameter("DL_GroupParameters_EC<EC>", Name::Curve(), ec); source.GetRequiredParameter("DL_GroupParameters_EC<EC>", Name::SubgroupGenerator(), G); source.GetRequiredParameter("DL_GroupParameters_EC<EC>", Name::SubgroupOrder(), n); Integer k = source.GetValueWithDefault(Name::Cofactor(), Integer::Zero()); Initialize(ec, G, n, k); } }
void Grouper::IsolatedInitialize(const NameValuePairs ¶meters) { m_groupSize = parameters.GetIntValueWithDefault("GroupSize", 0); ConstByteArrayParameter seperator, terminator; if (m_groupSize) parameters.GetRequiredParameter("Grouper", "Seperator", seperator); else parameters.GetValue("Seperator", seperator); parameters.GetValue("Terminator", terminator); m_seperator.Assign(seperator.begin(), seperator.size()); m_terminator.Assign(terminator.begin(), terminator.size()); m_counter = 0; }
void BaseN_Decoder::IsolatedInitialize(const NameValuePairs ¶meters) { parameters.GetRequiredParameter("BaseN_Decoder", "DecodingLookupArray", m_lookup); parameters.GetRequiredIntParameter("BaseN_Decoder", "Log2Base", m_bitsPerChar); if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8) throw InvalidArgument("BaseN_Decoder: Log2Base must be between 1 and 7 inclusive"); m_bytePos = m_bitPos = 0; int i = m_bitsPerChar; while (i%8 != 0) i += m_bitsPerChar; m_outputBlockSize = i/8; m_outBuf.New(m_outputBlockSize); }
void RandomNumberSink::IsolatedInitialize(const NameValuePairs ¶meters) { parameters.GetRequiredParameter("RandomNumberSink", "RandomNumberGeneratorPointer", m_rng); }