| 440 | } |
| 441 | |
| 442 | template <class EC> void DL_GroupParameters_EC<EC>::Initialize(const OID &oid) |
| 443 | { |
| 444 | const EcRecommendedParameters<EllipticCurve> *begin, *end; |
| 445 | GetRecommendedParameters(begin, end); |
| 446 | const EcRecommendedParameters<EllipticCurve> *it = std::lower_bound(begin, end, oid, OIDLessThan()); |
| 447 | if (it == end || it->oid != oid) |
| 448 | throw UnknownOID(); |
| 449 | |
| 450 | const EcRecommendedParameters<EllipticCurve> ¶m = *it; |
| 451 | m_oid = oid; |
| 452 | member_ptr<EllipticCurve> ec(param.NewEC()); |
| 453 | this->m_groupPrecomputation.SetCurve(*ec); |
| 454 | |
| 455 | StringSource ssG(param.g, true, new HexDecoder); |
| 456 | Element G; |
| 457 | bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable()); |
| 458 | this->SetSubgroupGenerator(G); |
| 459 | |
| 460 | // TODO: this fails in practice. Should it throw? |
| 461 | CRYPTOPP_UNUSED(result); CRYPTOPP_ASSERT(result); |
| 462 | |
| 463 | StringSource ssN(param.n, true, new HexDecoder); |
| 464 | m_n.Decode(ssN, (size_t)ssN.MaxRetrievable()); |
| 465 | m_k = param.h; |
| 466 | } |
| 467 | |
| 468 | template <class EC> |
| 469 | bool DL_GroupParameters_EC<EC>::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const |
nothing calls this directly
no test coverage detected