]> Git Repo - VerusCoin.git/blame - src/snark/src/algebra/scalar_multiplication/wnaf.hpp
Auto merge of #2795 - str4d:2351-sprout-circuit-value, r=str4d
[VerusCoin.git] / src / snark / src / algebra / scalar_multiplication / wnaf.hpp
CommitLineData
51e44864
JG
1/** @file
2 *****************************************************************************
3
4 Declaration of interfaces for wNAF ("width-w Non-Adjacent Form") exponentiation routines.
5
6 *****************************************************************************
7 * @author This file is part of libsnark, developed by SCIPR Lab
8 * and contributors (see AUTHORS).
9 * @copyright MIT license (see LICENSE file)
10 *****************************************************************************/
11
12#ifndef WNAF_HPP_
13#define WNAF_HPP_
14
15namespace libsnark {
16
17/**
18 * Find the wNAF representation of the given scalar relative to the given window size.
19 */
20template<mp_size_t n>
21std::vector<long> find_wnaf(const size_t window_size, const bigint<n> &scalar);
22
23/**
24 * In additive notation, use wNAF exponentiation (with the given window size) to compute scalar * base.
25 */
26template<typename T, mp_size_t n>
27T fixed_window_wnaf_exp(const size_t window_size, const T &base, const bigint<n> &scalar);
28
29/**
30 * In additive notation, use wNAF exponentiation (with the window size determined by T) to compute scalar * base.
31 */
32template<typename T, mp_size_t n>
33T opt_window_wnaf_exp(const T &base, const bigint<n> &scalar, const size_t scalar_bits);
34
35} // libsnark
36
37#include "algebra/scalar_multiplication/wnaf.tcc"
38
39#endif // WNAF_HPP_
This page took 0.032618 seconds and 4 git commands to generate.