| 98 | } |
| 99 | |
| 100 | void EC2N::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const |
| 101 | { |
| 102 | if (P.identity) |
| 103 | NullStore().TransferTo(bt, EncodedPointSize(compressed)); |
| 104 | else if (compressed) |
| 105 | { |
| 106 | bt.Put(2 + (!P.x ? 0 : m_field->Divide(P.y, P.x).GetBit(0))); |
| 107 | P.x.Encode(bt, m_field->MaxElementByteLength()); |
| 108 | } |
| 109 | else |
| 110 | { |
| 111 | unsigned int len = m_field->MaxElementByteLength(); |
| 112 | bt.Put(4); // uncompressed |
| 113 | P.x.Encode(bt, len); |
| 114 | P.y.Encode(bt, len); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | void EC2N::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const |
| 119 | { |
nothing calls this directly
no test coverage detected