chromium/third_party/private-join-and-compute/src/crypto/big_num.h

/*
 * 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.
 */

#ifndef CRYPTO_BIG_NUM_H_
#define CRYPTO_BIG_NUM_H_

#include <stdint.h>

#include <memory>
#include <string>

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

// Immutable wrapper class for openssl BIGNUM numbers.
// Used for arithmetic operations on big numbers.
// Makes use of a BN_CTX structure that holds temporary BIGNUMs needed for
// arithmetic operations as dynamic memory allocation to create BIGNUMs is
// expensive.
class BigNum {};

inline BigNum operator-(const BigNum& a) {}

inline BigNum operator+(const BigNum& a, const BigNum& b) {}

inline BigNum operator*(const BigNum& a, const BigNum& b) {}

inline BigNum operator-(const BigNum& a, const BigNum& b) {}

// Returns a BigNum whose value is (a / b).
// Causes a check failure if the remainder != 0.
inline BigNum operator/(const BigNum& a, const BigNum& b) {}

inline BigNum& operator+=(BigNum& a, const BigNum& b) {}

inline BigNum& operator*=(BigNum& a, const BigNum& b) {}

inline BigNum& operator-=(BigNum& a, const BigNum& b) {}

inline BigNum& operator/=(BigNum& a, const BigNum& b) {}

inline bool operator==(const BigNum& a, const BigNum& b) {}

inline bool operator!=(const BigNum& a, const BigNum& b) {}

inline bool operator<(const BigNum& a, const BigNum& b) {}

inline bool operator>(const BigNum& a, const BigNum& b) {}

inline bool operator<=(const BigNum& a, const BigNum& b) {}

inline bool operator>=(const BigNum& a, const BigNum& b) {}

inline BigNum operator%(const BigNum& a, const BigNum& m) {}

inline BigNum operator>>(const BigNum& a, int n) {}

inline BigNum operator<<(const BigNum& a, int n) {}

inline BigNum& operator%=(BigNum& a, const BigNum& b) {}

inline BigNum& operator>>=(BigNum& a, int n) {}

inline BigNum& operator<<=(BigNum& a, int n) {}

}  // namespace private_join_and_compute

#endif  // CRYPTO_BIG_NUM_H_