| 119 | } |
| 120 | |
| 121 | void ECP::EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const |
| 122 | { |
| 123 | if (P.identity) |
| 124 | NullStore().TransferTo(bt, EncodedPointSize(compressed)); |
| 125 | else if (compressed) |
| 126 | { |
| 127 | bt.Put(2 + P.y.GetBit(0)); |
| 128 | P.x.Encode(bt, GetField().MaxElementByteLength()); |
| 129 | } |
| 130 | else |
| 131 | { |
| 132 | unsigned int len = GetField().MaxElementByteLength(); |
| 133 | bt.Put(4); // uncompressed |
| 134 | P.x.Encode(bt, len); |
| 135 | P.y.Encode(bt, len); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | void ECP::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const |
| 140 | { |
no test coverage detected