MCPcopy Create free account
hub / github.com/LUX-Core/lux / BERDecode

Method BERDecode

src/cryptopp/eccrypto.cpp:521–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519
520template <class EC>
521void DL_GroupParameters_EC<EC>::BERDecode(BufferedTransformation &bt)
522{
523 byte b;
524 if (!bt.Peek(b))
525 BERDecodeError();
526 if (b == OBJECT_IDENTIFIER)
527 Initialize(OID(bt));
528 else
529 {
530 BERSequenceDecoder seq(bt);
531 word32 version;
532 BERDecodeUnsigned<word32>(seq, version, INTEGER, 1, 1); // check version
533 EllipticCurve ec(seq);
534 Point G = ec.BERDecodePoint(seq);
535 Integer n(seq);
536 Integer k;
537 bool cofactorPresent = !seq.EndReached();
538 if (cofactorPresent)
539 k.BERDecode(seq);
540 else
541 k = Integer::Zero();
542 seq.MessageEnd();
543
544 Initialize(ec, G, n, k);
545 }
546}
547
548template <class EC>
549void DL_GroupParameters_EC<EC>::DEREncode(BufferedTransformation &bt) const

Callers 1

BERDecodePrivateKeyMethod · 0.45

Calls 7

BERDecodeErrorFunction · 0.85
EndReachedMethod · 0.80
MessageEndMethod · 0.80
InitializeFunction · 0.70
OIDFunction · 0.70
PeekMethod · 0.45
BERDecodePointMethod · 0.45

Tested by

no test coverage detected