#include "third_party/private-join-and-compute/src/crypto/ec_group.h"
#include <algorithm>
#include <utility>
#include "third_party/private-join-and-compute/src/crypto/ec_point.h"
#include "third_party/private-join-and-compute/src/crypto/openssl.inc"
#include "third_party/private-join-and-compute/src/util/status.inc"
namespace private_join_and_compute {
namespace {
StatusOr<ECGroup::ECGroupPtr> CreateGroup(int curve_id) { … }
StatusOr<BigNum> CreateOrder(const EC_GROUP* group, Context* context) { … }
StatusOr<BigNum> CreateCofactor(const EC_GROUP* group, Context* context) { … }
StatusOr<ECGroup::CurveParams> CreateCurveParams(const EC_GROUP* group,
Context* context) { … }
BigNum GetPMinusOneOverTwo(const ECGroup::CurveParams& curve_params,
Context* context) { … }
}
ECGroup::ECGroup(Context* context, ECGroupPtr group, BigNum order,
BigNum cofactor, CurveParams curve_params,
BigNum p_minus_one_over_two)
: … { … }
StatusOr<ECGroup> ECGroup::Create(int curve_id, Context* context) { … }
BigNum ECGroup::GeneratePrivateKey() const { … }
Status ECGroup::CheckPrivateKey(const BigNum& priv_key) const { … }
StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveInternal(
const BigNum& x) const { … }
StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha256(
const std::string& m) const { … }
StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha512(
const std::string& m) const { … }
BigNum ECGroup::ComputeYSquare(const BigNum& x) const { … }
bool ECGroup::IsValid(const ECPoint& point) const { … }
bool ECGroup::IsOnCurve(const ECPoint& point) const { … }
bool ECGroup::IsAtInfinity(const ECPoint& point) const { … }
bool ECGroup::IsSquare(const BigNum& q) const { … }
StatusOr<ECPoint> ECGroup::GetFixedGenerator() const { … }
StatusOr<ECPoint> ECGroup::GetRandomGenerator() const { … }
StatusOr<ECPoint> ECGroup::CreateECPoint(const BigNum& x,
const BigNum& y) const { … }
StatusOr<ECPoint> ECGroup::CreateECPoint(const std::string& bytes) const { … }
StatusOr<ECPoint> ECGroup::GetPointAtInfinity() const { … }
}