Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 16, 2023
1 parent 6789e2e commit d901cb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/evmmax/evmmax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace evmmax
{

/// The modular arithmetic operations for EVMMAX (EVM Modular Arithmetic Extensions).
template <typename UintT>
class ModArith
{
Expand All @@ -22,14 +24,19 @@ class ModArith
public:
explicit ModArith(const UintT& modulus) noexcept;

/// Converts a value to Montgomery form.
uint to_mont(const uint& x) const noexcept;

/// Converts a value in Montgomery form back to normal value.
uint from_mont(const uint& x) const noexcept;

/// Performs a Montgomery modular multiplication. Inputs must be in Montgomery form.
uint mul(const uint& x, const uint& y) const noexcept;

/// Performs a modular addition.
uint add(const uint& x, const uint& y) const noexcept;

/// Performs a modular subtraction.
uint sub(const uint& x, const uint& y) const noexcept;
};
} // namespace evmmax

0 comments on commit d901cb1

Please sign in to comment.