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

Method EncodePoint

src/cryptopp/ec2n.cpp:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void 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
118void EC2N::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const
119{

Callers

nothing calls this directly

Calls 5

TransferToMethod · 0.80
EncodedPointSizeFunction · 0.70
PutMethod · 0.45
DivideMethod · 0.45
EncodeMethod · 0.45

Tested by

no test coverage detected