| 76 | } |
| 77 | |
| 78 | P256Element::Scalar P256Element::x() const |
| 79 | { |
| 80 | BIGNUM* x = BN_new(); |
| 81 | #if OPENSSL_VERSION_MAJOR >= 3 |
| 82 | assert(EC_POINT_get_affine_coordinates(curve, point, x, 0, 0) != 0); |
| 83 | #else |
| 84 | assert(EC_POINT_get_affine_coordinates_GFp(curve, point, x, 0, 0) != 0); |
| 85 | #endif |
| 86 | char* xx = BN_bn2dec(x); |
| 87 | Scalar res((bigint(xx))); |
| 88 | OPENSSL_free(xx); |
| 89 | BN_free(x); |
| 90 | return res; |
| 91 | } |
| 92 | |
| 93 | P256Element P256Element::operator +(const P256Element& other) const |
| 94 | { |