nil::crypto3::algebra Namespace Reference

Namespaces

 curves
 
 detail
 
 fields
 
 pairing
 
 policies
 

Classes

struct  is_complex
 
struct  is_complex< std::complex< T > >
 
struct  is_curve
 
struct  is_curve_group
 
struct  is_extended_field
 
struct  is_field
 
struct  is_g1_group_element
 
struct  is_g2_group_element
 
struct  is_group_element
 
struct  matrix
 A container representing a matrix. More...
 
struct  remove_complex
 
struct  remove_complex< std::complex< T > >
 
struct  vector
 A container representing a vector. More...
 

Typedefs

template<typename T >
using remove_complex_t = typename remove_complex< T >::type
 
template<typename GroupType >
using window_table = std::vector< std::vector< typename GroupType::value_type > >
 

Functions

template<typename T , std::size_t N>
constexpr vector< nil::crypto3::detail::remove_complex_t< T >, N > abs (const vector< T, N > &v)
 computes the elementwise absolute value More...
 
template<typename T >
constexpr nil::crypto3::detail::remove_complex_t< T > abs (T x)
 computes the absolute value More...
 
template<typename T , std::size_t N, typename F , typename U >
constexpr U accumulate (const vector< T, N > &v, U init, F &&f)
 accumulates an operation across a vector More...
 
template<typename T , std::size_t N>
constexpr matrix< T, N, 1 > as_column (const vector< T, N > &v)
 converts a vector into a column vector More...
 
template<typename T , std::size_t N>
constexpr matrix< T, 1, N > as_row (const vector< T, N > &v)
 converts a vector into a row vector More...
 
template<typename GroupType , typename FieldType , typename InputRange , typename = typename std::enable_if< std::is_same<typename InputRange::value_type, typename FieldType::value_type>::value>::type>
std::vector< typename GroupType::value_type > batch_exp (const std::size_t scalar_size, const std::size_t window, const window_table< GroupType > &table, const InputRange &v)
 
template<typename GroupType , typename FieldType , typename InputRange , typename = typename std::enable_if< std::is_same<typename InputRange::value_type, typename FieldType::value_type>::value>::type>
std::vector< typename GroupType::value_type > batch_exp_with_coeff (const std::size_t scalar_size, const std::size_t window, const window_table< GroupType > &table, const typename FieldType::value_type &coeff, const InputRange &v)
 
template<typename GroupType , typename InputRange >
std::enable_if< std::is_same< typename InputRange::value_type, typename GroupType::value_type >::value, void >::type batch_to_special (InputRange &vec)
 
template<typename T , typename U , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > cast (const matrix< U, N, M > &m)
 casts a vector to another type More...
 
template<typename T , typename U , std::size_t N>
constexpr vector< T, N > cast (const vector< U, N > &v)
 casts a vector to another type More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr vector< T, N+M > concat (vector< T, N > a, vector< T, M > b)
 concatenates two vectors More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< T, M, N > conj (const matrix< T, M, N > &m)
 computes the elementwise complex conjugate More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > conj (const vector< T, N > &v)
 computes the elementwise complex conjugate More...
 
template<typename T >
constexpr T conj (T x)
 computes the complex conjugate More...
 
template<typename T , std::size_t M>
constexpr T det (const matrix< T, M, M > &m)
 Compute the determinant. More...
 
template<typename T , std::size_t N>
constexpr T dot (const vector< T, N > &a, const vector< T, N > &b)
 computes the dot product More...
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type double_miller_loop (const typename PairingPolicy::g1_precomputed_type &prec_P1, const typename PairingPolicy::g2_precomputed_type &prec_Q1, const typename PairingPolicy::g1_precomputed_type &prec_P2, const typename PairingPolicy::g2_precomputed_type &prec_Q2)
 
template<typename F , typename T , typename... Matrices, typename U = std::invoke_result_t<F, T, typename Matrices::value_type...>, std::size_t N = detail::all_same_value<std::size_t, Matrices::column_size...>::value, std::size_t M = detail::all_same_value<std::size_t, Matrices::row_size...>::value>
constexpr matrix< U, N, M > elementwise (F f, const matrix< T, N, M > &m, const Matrices &...matrices)
 applies a function elementwise between many matrices More...
 
template<typename F , typename T , typename... Vectors, typename U = std::invoke_result_t<F, T, typename Vectors::value_type...>, std::size_t N = detail::all_same_value<std::size_t, Vectors::size...>::value>
constexpr vector< U, N > elementwise (F f, const vector< T, N > &v, const Vectors &...vectors)
 applies a function elementwise between many vectors More...
 
constexpr double exponentiate (double x, int n)
 computes exponents More...
 
template<std::size_t N, std::size_t M, typename T >
constexpr matrix< T, N, M > fill (T value)
 generates a matrix containing a single value More...
 
template<std::size_t N, typename T >
constexpr vector< T, N > fill (T value)
 generates a vector containing a single value More...
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type final_exponentiation (const typename PairingCurveType::gt_type::value_type &elt)
 
template<typename BaseValueType , typename Backend , multiprecision::expression_template_option ExpressionTemplates>
BaseValueType fixed_window_wnaf_exp (const std::size_t window_size, const BaseValueType &base, const multiprecision::number< Backend, ExpressionTemplates > &scalar)
 
template<std::size_t N, std::size_t M, typename F >
constexpr decltype(auto) generate (F &&f)
 generates a matrix as a function of its indices More...
 
template<std::size_t N, typename F >
constexpr decltype(auto) generate (F &&f)
 generates a vector as a function of its index More...
 
template<typename GroupType >
std::size_t get_exp_window_size (const std::size_t num_scalars)
 
template<typename T , std::size_t N>
constexpr matrix< T, N, N > get_identity ()
 
template<typename GroupType >
window_table< GroupType > get_window_table (const std::size_t scalar_size, const std::size_t window, const typename GroupType::value_type &g)
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< T, N, M > hermitian (const matrix< T, M, N > &m)
 computes the Hermitian transpose More...
 
template<std::size_t M, std::size_t N, std::size_t P, typename T >
constexpr matrix< T, M, N+P > horzcat (const matrix< T, M, N > &a, const matrix< T, M, P > &b)
 horizontally concatenates two matrices More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< nil::crypto3::detail::remove_complex_t< T >, M, N > imag (const matrix< T, M, N > &m)
 computes the elementwise imag More...
 
template<typename T , std::size_t N>
constexpr vector< nil::crypto3::detail::remove_complex_t< T >, N > imag (const vector< T, N > &v)
 computes the elementwise imag More...
 
template<typename InputBaseIterator >
std::iterator_traits< InputBaseIterator >::value_type inner_product (InputBaseIterator a_begin, InputBaseIterator a_end, InputBaseIterator b_begin, InputBaseIterator b_end)
 
template<typename T , std::size_t M>
constexpr matrix< T, M, M > inverse (const matrix< T, M, M > &m)
 computes the matrix inverse More...
 
template<std::size_t N, typename T >
constexpr vector< T, N > iota (T value=T())
 generates a vector containing consecutive elements More...
 
template<typename T , std::size_t M, std::size_t N, std::size_t P, std::size_t Q>
constexpr matrix< T, M *P, N *Q > kron (const matrix< T, M, N > &a, const matrix< T, P, Q > &b)
 Computes the kronecker tensor product. More...
 
template<std::size_t N, typename T >
constexpr vector< T, N > linspace (T min, T max)
 generates a vector of equally spaced elements More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr T macs (const matrix< T, M, N > &m)
 Computes the maximum absolute column sum norm. More...
 
template<typename... Args>
constexpr decltype(auto) make_vector (Args... args)
 constructs a vector from arguments More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr T mars (const matrix< T, M, N > &m)
 Computes the maximum absolute row sum norm. More...
 
template<typename T , std::size_t M, std::size_t N, std::size_t P>
constexpr matrix< T, M, P > matmul (const matrix< T, M, N > &a, const matrix< T, N, P > &b)
 computes the matrix product More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr vector< T, M > matvectmul (const matrix< T, M, N > &m, const vector< T, N > &v)
 computes the product of matrix and vector More...
 
template<typename T , std::size_t N>
constexpr T max (const vector< T, N > &v)
 computes the maximum valued element More...
 
template<typename T , std::size_t N>
constexpr std::size_t max_index (const vector< T, N > &v)
 computes the index of the maximum valued element More...
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type miller_loop (const typename PairingPolicy::g1_precomputed_type &prec_P, const typename PairingPolicy::g2_precomputed_type &prec_Q)
 
template<typename T , std::size_t N>
constexpr T min (const vector< T, N > &v)
 computes the minimum valued element More...
 
template<typename T , std::size_t N>
constexpr std::size_t min_index (const vector< T, N > &v)
 computes the index of the minimum valued element More...
 
template<typename MultiexpMethod , typename InputBaseIterator , typename InputFieldIterator >
std::iterator_traits< InputBaseIterator >::value_type multiexp (InputBaseIterator vec_start, InputBaseIterator vec_end, InputFieldIterator scalar_start, InputFieldIterator scalar_end, const std::size_t chunks_count)
 
template<typename MultiexpMethod , typename InputBaseIterator , typename InputFieldIterator >
std::iterator_traits< InputBaseIterator >::value_type multiexp_with_mixed_addition (InputBaseIterator vec_start, InputBaseIterator vec_end, InputFieldIterator scalar_start, InputFieldIterator scalar_end, const std::size_t chunks_count)
 
constexpr double nthroot (double x, int n)
 computes the $n$th root More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr bool operator!= (const matrix< T, N, M > &a, const matrix< T, N, M > &b)
 checks inequality of two matrices More...
 
template<typename T , std::size_t N>
constexpr bool operator!= (const vector< T, N > &a, const vector< T, N > &b)
 checks inequality of two vectors More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator* (const matrix< T, N, M > &a, const matrix< T, N, M > &b)
 computes the Hadamard product More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator* (const matrix< T, N, M > &m, T a)
 computes the product of a matrix and a scalar More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator* (const vector< T, N > &a, const vector< T, N > &b)
 computes the Hadamard product More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator* (const vector< T, N > &v, T a)
 computes the product of a vector and a scalar More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator* (T a, const matrix< T, N, M > &m)
 computes the product of a matrix and a scalar More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator* (T a, const vector< T, N > &v)
 computes the product of a vector and a scalar More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (const matrix< T, N, M > &a, const matrix< T, N, M > &b)
 computes the matrix sum More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (const matrix< T, N, M > &m, T a)
 computes the sum of a matrix and a scalar More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator+ (const vector< T, N > &a, const vector< T, N > &b)
 computes the vector sum More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator+ (const vector< T, N > &v, T a)
 computes the sum of a vector and a scalar More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (T a, const matrix< T, N, M > &m)
 computes the sum of a matrix and a scalar More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator+ (T a, const vector< T, N > &v)
 computes the sum of a vector and a scalar More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator/ (const matrix< T, N, M > &a, const matrix< T, N, M > &b)
 computes the elementwise matrix quotient More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator/ (const vector< T, N > &a, const vector< T, N > &b)
 computes the elementwise vector quotient More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator/ (T a, const matrix< T, N, M > &m)
 computes the quotient between a matrix and a scalar More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > operator/ (T a, const vector< T, N > &v)
 computes the quotient between a vector and a scalar More...
 
template<typename T , std::size_t N, std::size_t M>
constexpr bool operator== (const matrix< T, N, M > &a, const matrix< T, N, M > &b)
 checks equality of two matrices More...
 
template<typename T , std::size_t N>
constexpr bool operator== (const vector< T, N > &a, const vector< T, N > &b)
 checks equality of two vectors More...
 
template<typename CurveGroupValueType , typename Backend , multiprecision::expression_template_option ExpressionTemplates>
CurveGroupValueType opt_window_wnaf_exp (const CurveGroupValueType &base, const multiprecision::number< Backend, ExpressionTemplates > &scalar, const std::size_t scalar_bits)
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type pair (const typename PairingCurveType::template g1_type<>::value_type &v1, const typename PairingCurveType::template g2_type<>::value_type &v2)
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type pair_reduced (const typename PairingCurveType::template g1_type<>::value_type &v1, const typename PairingCurveType::template g2_type<>::value_type &v2)
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingPolicy::g1_precomputed_type precompute_g1 (const typename PairingCurveType::template g1_type<>::value_type &P)
 
template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingPolicy::g2_precomputed_type precompute_g2 (const typename PairingCurveType::template g2_type<>::value_type &P)
 
template<typename FieldType , typename DistributionType = boost::random::uniform_int_distribution<typename FieldType::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if< is_field< FieldType >::value &&!(is_extended_field< FieldType >::value), typename FieldType::value_type >::type random_element ()
 
template<typename FieldType , typename DistributionType = boost::random::uniform_int_distribution<typename FieldType::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if< is_field< FieldType >::value &&is_extended_field< FieldType >::value, typename FieldType::value_type >::type random_element ()
 
template<typename CurveGroupType , typename DistributionType = boost::random::uniform_int_distribution<typename CurveGroupType::field_type::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if< is_curve_group< CurveGroupType >::value, typename CurveGroupType::value_type >::type random_element ()
 
template<typename T , std::size_t M, std::size_t N>
constexpr std::size_t rank (const matrix< T, M, N > &m)
 Compute the rank. More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< nil::crypto3::detail::remove_complex_t< T >, M, N > real (const matrix< T, M, N > &m)
 computes the elementwise real More...
 
template<typename T , std::size_t N>
constexpr vector< nil::crypto3::detail::remove_complex_t< T >, N > real (const vector< T, N > &v)
 computes the elementwise real More...
 
template<std::size_t Row, std::size_t Col, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M *Row, N *Col > repmat (const matrix< T, M, N > &m)
 repeats a matrix More...
 
template<std::size_t P, std::size_t Q, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, P, Q > reshape (const matrix< T, M, N > &m)
 reshapes a matrix More...
 
template<std::size_t N, typename T >
constexpr vector< T, N > rotate (vector< T, N > v, int n)
 shifts vector elements More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< T, M, N > rref (const matrix< T, M, N > &m)
 Compute the reduced row echelon form. More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< T, M, N > rref (const matrix< T, M, N > &m, T tolerance)
 Compute the reduced row echelon form. More...
 
template<std::size_t M, typename T , std::size_t N>
constexpr vector< T, M > slice (vector< T, N > v, std::size_t start=0)
 slices a vector into a subvector More...
 
template<typename T , std::size_t N>
constexpr vector< T, N > sqrt (const vector< T, N > &v)
 computes the elementwise square root More...
 
constexpr double sqrt (double x)
 computes the square root More...
 
constexpr float sqrt (float x)
 computes the square root More...
 
template<typename InputType , typename OutputType >
constexpr void strxor (const InputType &in1, const InputType &in2, OutputType &out)
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
constexpr std::enable_if< std::is_same< typename std::iterator_traits< InputIterator1 >::value_type, typename std::iterator_traits< InputIterator2 >::value_type >::value, OutputIterator >::type strxor (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator out)
 
template<std::size_t P, std::size_t Q, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, P, Q > submat (const matrix< T, M, N > &m, std::size_t a, std::size_t b)
 extracts the submatrix of a matrix More...
 
template<typename T , std::size_t N>
constexpr T sum (const vector< T, N > &v)
 computes the sum of elements More...
 
template<std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M, N > swapcol (matrix< T, M, N > m, std::size_t a, std::size_t b)
 swaps columns of a matrix More...
 
template<std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M, N > swaprow (matrix< T, M, N > m, std::size_t a, std::size_t b)
 swaps rows of a matrix More...
 
template<typename T , std::size_t M>
constexpr T trace (const matrix< T, M, M > &m)
 computes the trace More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr matrix< T, N, M > transpose (const matrix< T, M, N > &m)
 computes the transpose More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr vector< T, N > vectmatmul (const vector< T, M > &v, const matrix< T, M, N > &m)
 computes the product of vector and matrix More...
 
template<std::size_t M, std::size_t N, std::size_t P, typename T >
constexpr matrix< T, M+N, P > vertcat (const matrix< T, M, P > &a, const matrix< T, N, P > &b)
 vertically concatenates two matrices More...
 
template<typename GroupType , typename FieldType >
GroupType::value_type windowed_exp (const std::size_t scalar_size, const std::size_t window, const window_table< GroupType > &powers_of_g, const typename FieldType::value_type &pow)
 
matrix deduction guides
template<typename T , std::size_t M, std::size_t N>
 matrix (const T(&)[M][N]) -> matrix< T, M, N >
 deduction guide for aggregate initialization More...
 
vector deduction guides
template<typename T , typename... U>
 vector (T, U...) -> vector< std::enable_if_t<(std::is_same_v< T, U > &&...), T >, 1+sizeof...(U)>
 deduction guide for uniform initialization More...
 
template<typename T , std::size_t N>
 vector (const T(&)[N]) -> vector< T, N >
 deduction guide for aggregate initialization More...
 

Variables

template<typename T , std::size_t N>
const matrix< T, N, N > identity
 the matrix identity More...
 
template<typename T >
constexpr bool is_complex_v = is_complex<T>::value
 

Typedef Documentation

◆ remove_complex_t

template<typename T >
using nil::crypto3::algebra::remove_complex_t = typedef typename remove_complex<T>::type

◆ window_table

template<typename GroupType >
using nil::crypto3::algebra::window_table = typedef std::vector<std::vector<typename GroupType::value_type> >

A window table stores window sizes for different instance sizes for fixed-base multi-scalar multiplications.

Function Documentation

◆ batch_exp()

template<typename GroupType , typename FieldType , typename InputRange , typename = typename std::enable_if< std::is_same<typename InputRange::value_type, typename FieldType::value_type>::value>::type>
std::vector<typename GroupType::value_type> nil::crypto3::algebra::batch_exp ( const std::size_t  scalar_size,
const std::size_t  window,
const window_table< GroupType > &  table,
const InputRange &  v 
)

◆ batch_exp_with_coeff()

template<typename GroupType , typename FieldType , typename InputRange , typename = typename std::enable_if< std::is_same<typename InputRange::value_type, typename FieldType::value_type>::value>::type>
std::vector<typename GroupType::value_type> nil::crypto3::algebra::batch_exp_with_coeff ( const std::size_t  scalar_size,
const std::size_t  window,
const window_table< GroupType > &  table,
const typename FieldType::value_type &  coeff,
const InputRange &  v 
)

◆ batch_to_special()

template<typename GroupType , typename InputRange >
std::enable_if< std::is_same<typename InputRange::value_type, typename GroupType::value_type>::value, void>::type nil::crypto3::algebra::batch_to_special ( InputRange &  vec)

◆ double_miller_loop()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type nil::crypto3::algebra::double_miller_loop ( const typename PairingPolicy::g1_precomputed_type &  prec_P1,
const typename PairingPolicy::g2_precomputed_type &  prec_Q1,
const typename PairingPolicy::g1_precomputed_type &  prec_P2,
const typename PairingPolicy::g2_precomputed_type &  prec_Q2 
)

◆ final_exponentiation()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type nil::crypto3::algebra::final_exponentiation ( const typename PairingCurveType::gt_type::value_type &  elt)

◆ fixed_window_wnaf_exp()

template<typename BaseValueType , typename Backend , multiprecision::expression_template_option ExpressionTemplates>
BaseValueType nil::crypto3::algebra::fixed_window_wnaf_exp ( const std::size_t  window_size,
const BaseValueType &  base,
const multiprecision::number< Backend, ExpressionTemplates > &  scalar 
)

◆ get_exp_window_size()

template<typename GroupType >
std::size_t nil::crypto3::algebra::get_exp_window_size ( const std::size_t  num_scalars)

◆ get_window_table()

template<typename GroupType >
window_table<GroupType> nil::crypto3::algebra::get_window_table ( const std::size_t  scalar_size,
const std::size_t  window,
const typename GroupType::value_type &  g 
)

◆ inner_product()

template<typename InputBaseIterator >
std::iterator_traits<InputBaseIterator>::value_type nil::crypto3::algebra::inner_product ( InputBaseIterator  a_begin,
InputBaseIterator  a_end,
InputBaseIterator  b_begin,
InputBaseIterator  b_end 
)
inline

◆ miller_loop()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type nil::crypto3::algebra::miller_loop ( const typename PairingPolicy::g1_precomputed_type &  prec_P,
const typename PairingPolicy::g2_precomputed_type &  prec_Q 
)

◆ multiexp()

template<typename MultiexpMethod , typename InputBaseIterator , typename InputFieldIterator >
std::iterator_traits<InputBaseIterator>::value_type nil::crypto3::algebra::multiexp ( InputBaseIterator  vec_start,
InputBaseIterator  vec_end,
InputFieldIterator  scalar_start,
InputFieldIterator  scalar_end,
const std::size_t  chunks_count 
)

◆ multiexp_with_mixed_addition()

template<typename MultiexpMethod , typename InputBaseIterator , typename InputFieldIterator >
std::iterator_traits<InputBaseIterator>::value_type nil::crypto3::algebra::multiexp_with_mixed_addition ( InputBaseIterator  vec_start,
InputBaseIterator  vec_end,
InputFieldIterator  scalar_start,
InputFieldIterator  scalar_end,
const std::size_t  chunks_count 
)

◆ opt_window_wnaf_exp()

template<typename CurveGroupValueType , typename Backend , multiprecision::expression_template_option ExpressionTemplates>
CurveGroupValueType nil::crypto3::algebra::opt_window_wnaf_exp ( const CurveGroupValueType &  base,
const multiprecision::number< Backend, ExpressionTemplates > &  scalar,
const std::size_t  scalar_bits 
)

◆ pair()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type nil::crypto3::algebra::pair ( const typename PairingCurveType::template g1_type<>::value_type &  v1,
const typename PairingCurveType::template g2_type<>::value_type &  v2 
)

◆ pair_reduced()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingCurveType::gt_type::value_type nil::crypto3::algebra::pair_reduced ( const typename PairingCurveType::template g1_type<>::value_type &  v1,
const typename PairingCurveType::template g2_type<>::value_type &  v2 
)

◆ precompute_g1()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingPolicy::g1_precomputed_type nil::crypto3::algebra::precompute_g1 ( const typename PairingCurveType::template g1_type<>::value_type &  P)

◆ precompute_g2()

template<typename PairingCurveType , typename PairingPolicy = pairing::pairing_policy<PairingCurveType>>
PairingPolicy::g2_precomputed_type nil::crypto3::algebra::precompute_g2 ( const typename PairingCurveType::template g2_type<>::value_type &  P)

◆ random_element() [1/3]

template<typename FieldType , typename DistributionType = boost::random::uniform_int_distribution<typename FieldType::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if<is_field<FieldType>::value && !(is_extended_field<FieldType>::value), typename FieldType::value_type>::type nil::crypto3::algebra::random_element ( )

◆ random_element() [2/3]

template<typename FieldType , typename DistributionType = boost::random::uniform_int_distribution<typename FieldType::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if<is_field<FieldType>::value && is_extended_field<FieldType>::value, typename FieldType::value_type>::type nil::crypto3::algebra::random_element ( )

◆ random_element() [3/3]

template<typename CurveGroupType , typename DistributionType = boost::random::uniform_int_distribution<typename CurveGroupType::field_type::integral_type>, typename GeneratorType = boost::random::mt19937>
std::enable_if<is_curve_group<CurveGroupType>::value, typename CurveGroupType::value_type>::type nil::crypto3::algebra::random_element ( )

◆ strxor() [1/2]

template<typename InputType , typename OutputType >
constexpr void nil::crypto3::algebra::strxor ( const InputType &  in1,
const InputType &  in2,
OutputType &  out 
)
inlineconstexpr

◆ strxor() [2/2]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
constexpr std::enable_if<std::is_same<typename std::iterator_traits<InputIterator1>::value_type, typename std::iterator_traits<InputIterator2>::value_type>::value, OutputIterator>::type nil::crypto3::algebra::strxor ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
InputIterator2  last2,
OutputIterator  out 
)
inlineconstexpr

◆ windowed_exp()

template<typename GroupType , typename FieldType >
GroupType::value_type nil::crypto3::algebra::windowed_exp ( const std::size_t  scalar_size,
const std::size_t  window,
const window_table< GroupType > &  powers_of_g,
const typename FieldType::value_type &  pow 
)

Variable Documentation

◆ is_complex_v

template<typename T >
constexpr bool nil::crypto3::algebra::is_complex_v = is_complex<T>::value
constexpr