@@ -54,21 +54,21 @@ class EC {
5454 */
5555 constexpr static std::size_t ByteSize (bool compressed = true ) {
5656 return 1 + (compressed ? 0 : Field::ByteSize ()) + Field::ByteSize ();
57- };
57+ }
5858
5959 /* *
6060 * @brief The size of a curve point in bits.
6161 */
6262 constexpr static std::size_t BitSize (bool compressed = true ) {
6363 return ByteSize (compressed) * 8 ;
64- };
64+ }
6565
6666 /* *
6767 * @brief A string indicating which curve this is.
6868 */
6969 constexpr static const char * Name () {
7070 return Curve::NAME;
71- };
71+ }
7272
7373 /* *
7474 * @brief Get the generator of this curve.
@@ -77,7 +77,7 @@ class EC {
7777 EC g;
7878 CurveSetGenerator<Curve>(g.m_value );
7979 return g;
80- };
80+ } // LCOV_EXCL_LINE
8181
8282 /* *
8383 * @brief Read an elliptic curve point from bytes.
@@ -88,7 +88,7 @@ class EC {
8888 EC e;
8989 CurveFromBytes<Curve>(e.m_value , src);
9090 return e;
91- };
91+ } // LCOV_EXCL_LINE
9292
9393 /* *
9494 * @brief Create a point from an pair of affine coordinates.
@@ -97,14 +97,19 @@ class EC {
9797 EC e;
9898 CurveSetAffine<Curve>(e.m_value , x, y);
9999 return e;
100- };
100+ }
101101
102102 /* *
103103 * @brief Create a new point equal to the point at infinity.
104104 */
105105 explicit constexpr EC () {
106106 CurveSetPointAtInfinity<Curve>(m_value);
107- };
107+ }
108+
109+ /* *
110+ * @brief Destructor. Does nothing.
111+ */
112+ ~EC () {}
108113
109114 /* *
110115 * @brief Add another EC point to this.
@@ -114,7 +119,7 @@ class EC {
114119 EC& operator +=(const EC& other) {
115120 CurveAdd<Curve>(m_value, other.m_value );
116121 return *this ;
117- };
122+ }
118123
119124 /* *
120125 * @brief Add two points.
@@ -125,7 +130,7 @@ class EC {
125130 friend EC operator +(const EC& lhs, const EC& rhs) {
126131 EC copy (lhs);
127132 return copy += rhs;
128- };
133+ }
129134
130135 /* *
131136 * @brief Double this point.
@@ -134,7 +139,7 @@ class EC {
134139 EC& DoubleInPlace () {
135140 CurveDouble<Curve>(m_value);
136141 return *this ;
137- };
142+ }
138143
139144 /* *
140145 * @brief Double this point.
@@ -143,7 +148,7 @@ class EC {
143148 EC Double () const {
144149 EC copy (*this );
145150 return copy.DoubleInPlace ();
146- };
151+ }
147152
148153 /* *
149154 * @brief Subtract another point from this.
@@ -153,7 +158,7 @@ class EC {
153158 EC& operator -=(const EC& other) {
154159 CurveSubtract<Curve>(m_value, other.m_value );
155160 return *this ;
156- };
161+ }
157162
158163 /* *
159164 * @brief Subtract two EC points.
@@ -164,7 +169,7 @@ class EC {
164169 friend EC operator -(const EC& lhs, const EC& rhs) {
165170 EC copy (lhs);
166171 return copy -= rhs;
167- };
172+ }
168173
169174 /* *
170175 * @brief Perform a scalar multiplication.
@@ -174,7 +179,7 @@ class EC {
174179 EC& operator *=(const Number& scalar) {
175180 CurveScalarMultiply<Curve>(m_value, scalar);
176181 return *this ;
177- };
182+ }
178183
179184 /* *
180185 * @brief Perform a scalar multiplication.
@@ -184,7 +189,7 @@ class EC {
184189 EC& operator *=(const Order& scalar) {
185190 CurveScalarMultiply<Curve>(m_value, scalar);
186191 return *this ;
187- };
192+ }
188193
189194 /* *
190195 * @brief Multiply a point with a scalar from the right.
@@ -195,7 +200,7 @@ class EC {
195200 friend EC operator *(const EC& point, const Number& scalar) {
196201 EC copy (point);
197202 return copy *= scalar;
198- };
203+ }
199204
200205 /* *
201206 * @brief Multiply a point with a scalar from the right.
@@ -206,7 +211,7 @@ class EC {
206211 friend EC operator *(const EC& point, const Order& scalar) {
207212 EC copy (point);
208213 return copy *= scalar;
209- };
214+ }
210215
211216 /* *
212217 * @brief Multiply a point with a scalar from the left.
@@ -216,7 +221,7 @@ class EC {
216221 */
217222 friend EC operator *(const Number& scalar, const EC& point) {
218223 return point * scalar;
219- };
224+ }
220225
221226 /* *
222227 * @brief Multiply a point with a scalar from the left.
@@ -227,7 +232,7 @@ class EC {
227232 friend EC operator *(const FF<typename Curve::Order>& scalar,
228233 const EC& point) {
229234 return point * scalar;
230- };
235+ }
231236
232237 /* *
233238 * @brief Negate this point.
@@ -245,7 +250,7 @@ class EC {
245250 EC operator -() {
246251 EC copy (*this );
247252 return copy.Negate ();
248- };
253+ }
249254
250255 /* *
251256 * @brief Check if this EC point is equal to another EC point.
@@ -254,52 +259,52 @@ class EC {
254259 */
255260 bool Equal (const EC& other) const {
256261 return CurveEqual<Curve>(m_value, other.m_value );
257- };
262+ }
258263
259264 /* *
260265 * @brief Equality operator for EC points.
261266 */
262267 friend bool operator ==(const EC& lhs, const EC& rhs) {
263268 return lhs.Equal (rhs);
264- };
269+ }
265270
266271 /* *
267272 * @brief In-equality operator for EC points.
268273 */
269274 friend bool operator !=(const EC& lhs, const EC& rhs) {
270275 return !(lhs == rhs);
271- };
276+ }
272277
273278 /* *
274279 * @brief Check if this point is equal to the point at inifity.
275280 * @return true if this point is equal to the point at inifity.
276281 */
277282 bool PointAtInfinity () const {
278283 return CurveIsPointAtInfinity<Curve>(m_value);
279- };
284+ }
280285
281286 /* *
282287 * @brief Return this point as a pair of affine coordinates.
283288 * @return this point as a pair of affine coordinates.
284289 */
285290 std::array<Field, 2 > ToAffine () const {
286291 return CurveToAffine<Curve>(m_value);
287- };
292+ }
288293
289294 /* *
290295 * @brief Output this point as a string.
291296 */
292297 std::string ToString () const {
293298 return CurveToString<Curve>(m_value);
294- };
299+ }
295300
296301 /* *
297302 * @brief Write the curve point to a STL output stream.
298303 * @see EC::ToString.
299304 */
300305 friend std::ostream& operator <<(std::ostream& os, const EC& point) {
301306 return os << point.ToString ();
302- };
307+ }
303308
304309 /* *
305310 * @brief Write this point to a buffer.
@@ -308,7 +313,7 @@ class EC {
308313 */
309314 void Write (unsigned char * dest, bool compress = true ) const {
310315 CurveToBytes<Curve>(dest, m_value, compress);
311- };
316+ }
312317
313318 private:
314319 typename Curve::ValueType m_value;
0 commit comments