Skip to content

Commit

Permalink
Merge pull request #6 from ZeroPass/develop
Browse files Browse the repository at this point in the history
Add missing function `generate_point`
  • Loading branch information
smlu committed Apr 13, 2023
2 parents b8d3ea8 + a55ae1c commit 31884ef
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions include/ack/ec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,21 @@ namespace ack {
using field_element_type = FieldElementT;
using point_type = PointT;

/**
* Generates a point from base point g and given scalar x.
*
* @tparam PointU - point type to create.
*
* @param x - scalar to multiply base point g with.
* @return PointU - point on the curve.
*/
template<typename PointU = point_type, typename IntT>
PointU generate_point(const IntT &x) const
{
return static_cast<const CurveT&>(*this)
.template generate_point<PointU>( x );
}

/**
* Returns curve field element from the given integer.
* @param x the integer to convert
Expand Down Expand Up @@ -1050,6 +1065,14 @@ namespace ack {
h( h )
{}

/**
* Generates a point from base point g and given scalar x.
*
* @tparam PointT - point type to create.
*
* @param x - scalar to multiply base point g with.
* @return PointT - point on the curve.
*/
template<typename PointT = point_type, typename IntT = BigNumT>
PointT generate_point(const IntT &x) const
{
Expand Down

0 comments on commit 31884ef

Please sign in to comment.