chromium/third_party/private-join-and-compute/src/crypto/ec_group.cc

/*
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#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 {

// Returns a group using the predefined underlying operations suggested by
// OpenSSL.
StatusOr<ECGroup::ECGroupPtr> CreateGroup(int curve_id) {}

// Returns the order of the group. For more information, see
// https://en.wikipedia.org/wiki/Elliptic-curve_cryptography#Domain_parameters.
StatusOr<BigNum> CreateOrder(const EC_GROUP* group, Context* context) {}

// Returns the cofactor of the group.
StatusOr<BigNum> CreateCofactor(const EC_GROUP* group, Context* context) {}

// Returns the parameters that define the curve. For more information, see
// https://en.wikipedia.org/wiki/Elliptic-curve_cryptography#Domain_parameters.
StatusOr<ECGroup::CurveParams> CreateCurveParams(const EC_GROUP* group,
                                                 Context* context) {}

// Returns (p - 1) / 2 where p is a curve-defining parameter.
BigNum GetPMinusOneOverTwo(const ECGroup::CurveParams& curve_params,
                           Context* context) {}

}  // namespace

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 {}

}  // namespace private_join_and_compute