chromium/third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.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_commutative_cipher.h"

#include <utility>

#include "third_party/private-join-and-compute/src/crypto/big_num.h"
#include "third_party/private-join-and-compute/src/crypto/ec_group.h"
#include "third_party/private-join-and-compute/src/util/status.inc"

namespace private_join_and_compute {
namespace {

// Invert private scalar using Fermat's Little Theorem to avoid side-channel
// attacks. This avoids the caveat of ModInverseBlinded, namely that the
// underlying BN_mod_inverse_blinded is not available on all platforms.
BigNum InvertPrivateScalar(const BigNum& scalar,
                           const ECGroup& ec_group,
                           Context& context) {}

}  // namespace

ECCommutativeCipher::ECCommutativeCipher(std::unique_ptr<Context> context,
                                         ECGroup group,
                                         BigNum private_key,
                                         HashType hash_type)
    :{}

bool ECCommutativeCipher::ValidateHashType(HashType hash_type) {}

StatusOr<std::unique_ptr<ECCommutativeCipher>>
ECCommutativeCipher::CreateWithNewKey(int curve_id, HashType hash_type) {}

StatusOr<std::unique_ptr<ECCommutativeCipher>>
ECCommutativeCipher::CreateFromKey(int curve_id, const std::string& key_bytes,
                                   HashType hash_type) {}

StatusOr<std::string> ECCommutativeCipher::Encrypt(
    const std::string& plaintext) const {}

StatusOr<std::string> ECCommutativeCipher::ReEncrypt(
    const std::string& ciphertext) const {}

StatusOr<ECPoint> ECCommutativeCipher::Encrypt(const ECPoint& point) const {}

StatusOr<std::string> ECCommutativeCipher::Decrypt(
    const std::string& ciphertext) const {}

std::string ECCommutativeCipher::GetPrivateKeyBytes() const {}

}  // namespace private_join_and_compute