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

Method EncodePoint

src/cryptopp/ecp.cpp:121–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void 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
139void ECP::EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const
140{

Callers 2

DEREncodePublicKeyMethod · 0.45
EncodeElementMethod · 0.45

Calls 5

GetFieldFunction · 0.85
TransferToMethod · 0.80
EncodedPointSizeFunction · 0.70
PutMethod · 0.45
EncodeMethod · 0.45

Tested by

no test coverage detected