| 519 | |
| 520 | template <class EC> |
| 521 | void 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 | |
| 548 | template <class EC> |
| 549 | void DL_GroupParameters_EC<EC>::DEREncode(BufferedTransformation &bt) const |
no test coverage detected