#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 {
BigNum InvertPrivateScalar(const BigNum& scalar,
const ECGroup& ec_group,
Context& context) { … }
}
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 { … }
}