Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function comments added to the header file #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/alt_bn128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ namespace nil {
// pairing::detail::alt_bn128_pairing_functions<Version>> pairing_policy;

typedef typename policy_type::gt_field_type gt_type;

/// Returns name of this curve.
static std::string name()
{ return "alt_bn128_" + std::to_string(Version); }
};

typedef alt_bn128<254> alt_bn128_254;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ namespace nil {
// pairing;

// constexpr static const bool has_affine_pairing = false;

/// Returns name of this curve.
static std::string name()
{ return "babyjubjub"; }
};

} // namespace curves
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/bls12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ namespace nil {

#endif
typedef typename policy_type::gt_field_type gt_type;

/// Returns name of this curve.
static std::string name()
{ return "bls12_" + std::to_string(Version); }
};

typedef bls12<381> bls12_381;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace nil {
template<typename Coordinates = coordinates::extended_with_a_minus_1,
typename Form = forms::montgomery>
using g1_type = typename detail::curve25519_g1<Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "curve25519"; }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/ed25519.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace nil {
template<typename Coordinates = coordinates::extended_with_a_minus_1,
typename Form = forms::twisted_edwards>
using g1_type = typename detail::curve25519_g1<Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "ed25519"; }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/edwards.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ namespace nil {
typedef typename policy_type::gt_field_type gt_type;

constexpr static const bool has_affine_pairing = false;

/// Returns name of this curve.
static std::string name()
{ return "edwards_" + std::to_string(Version); }
};

typedef edwards<183> edwards_183;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/frp_v1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ namespace nil {
0xB6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF_cppui_modular256;
constexpr static const integral_type y =
0x6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB_cppui_modular256;

/// Returns name of this curve.
static std::string name()
{ return "frp_v1_" + std::to_string(base_field_bits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/gost_A.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ namespace nil {
constexpr static const integral_type x = 0x1_cppui_modular256;
constexpr static const integral_type y =
0x8D91E471E0989CDA27DF505A453F2B7635294F2DDF23E3B122ACC99C9E9F1E14_cppui_modular256;

/// Returns name of this curve.
static std::string name()
{ return "gost_A_" + std::to_string(base_field_bits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/jubjub.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ namespace nil {
// pairing;

// constexpr static const bool has_affine_pairing = false;

/// Returns name of this curve.
static std::string name()
{ return "jubjub"; }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/mnt4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ namespace nil {
typedef typename policy_type::gt_field_type gt_type;

constexpr static const bool has_affine_pairing = true;

/// Returns name of this curve.
static std::string name()
{ return "mnt4_" + std::to_string(Version); }
};

typedef mnt4<298> mnt4_298;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/mnt6.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ namespace nil {
typedef typename policy_type::gt_field_type gt_type;

constexpr static const bool has_affine_pairing = true;

/// Returns name of this curve.
static std::string name()
{ return "mnt6_" + std::to_string(Version); }
};

typedef mnt6<298> mnt6_298;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/p192.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ namespace nil {

constexpr static const integral_type p =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF_cppui_modular192;

/// Returns name of this curve.
static std::string name()
{ return "p192_" + std::to_string(WordBits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/p224.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ namespace nil {

constexpr static const integral_type p =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001_cppui_modular224;

/// Returns name of this curve.
static std::string name()
{ return "p224_" + std::to_string(WordBits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/p384.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ namespace nil {

constexpr static const integral_type p =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF_cppui_modular384;

/// Returns name of this curve.
static std::string name()
{ return "p384_" + std::to_string(WordBits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/p521.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ namespace nil {

constexpr static const integral_type p =
0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF_cppui_modular521;

/// Returns name of this curve.
static std::string name()
{ return "p521_" + std::to_string(WordBits); }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/pallas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace nil {
template<typename Coordinates = coordinates::jacobian_with_a4_0,
typename Form = forms::short_weierstrass>
using g1_type = typename detail::pallas_g1<Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "pallas"; }
};
} // namespace curves
} // namespace algebra
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/secp_k1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ namespace nil {
template<typename Coordinates = coordinates::jacobian_with_a4_0,
typename Form = forms::short_weierstrass>
using g1_type = typename detail::secp_k1_g1<Version, Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "secp_k1_" + std::to_string(Version); }
};

typedef secp_k1<160> secp160k1;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/secp_r1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ namespace nil {

template<typename Coordinates = coordinates::projective, typename Form = forms::short_weierstrass>
using g1_type = typename detail::secp_r1_g1<Version, Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "secp_r1_" + std::to_string(Version); }
};

typedef secp_r1<160> secp160r1;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/sm2p_v1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ namespace nil {
0x32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7_cppui_modular256;
constexpr static const integral_type y =
0xBC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0_cppui_modular256;

/// Returns name of this curve.
static std::string name()
{ return "sm2p_v1_" + std::to_string(base_field_bits); }
};

typedef sm2p_v1<256> sm2p256v1;
Expand Down
4 changes: 4 additions & 0 deletions libs/algebra/include/nil/crypto3/algebra/curves/vesta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace nil {
template<typename Coordinates = coordinates::jacobian_with_a4_0,
typename Form = forms::short_weierstrass>
using g1_type = typename detail::vesta_g1<Form, Coordinates>;

/// Returns name of this curve.
static std::string name()
{ return "vesta"; }
};
} // namespace curves
} // namespace algebra
Expand Down
Loading
Loading