/** @file ***************************************************************************** * @author This file is part of libsnark, developed by SCIPR Lab * and contributors (see AUTHORS). * @copyright MIT license (see LICENSE file) *****************************************************************************/ #ifndef FIELD_UTILS_HPP_ #define FIELD_UTILS_HPP_ #include #include "common/utils.hpp" #include "algebra/fields/bigint.hpp" namespace libsnark { // returns root of unity of order n (for n a power of 2), if one exists template FieldT get_root_of_unity(const size_t n); template std::vector pack_int_vector_into_field_element_vector(const std::vector &v, const size_t w); template std::vector pack_bit_vector_into_field_element_vector(const bit_vector &v, const size_t chunk_bits); template std::vector pack_bit_vector_into_field_element_vector(const bit_vector &v); template std::vector convert_bit_vector_to_field_element_vector(const bit_vector &v); template bit_vector convert_field_element_vector_to_bit_vector(const std::vector &v); template bit_vector convert_field_element_to_bit_vector(const FieldT &el); template bit_vector convert_field_element_to_bit_vector(const FieldT &el, const size_t bitcount); template FieldT convert_bit_vector_to_field_element(const bit_vector &v); template void batch_invert(std::vector &vec); } // libsnark #include "algebra/fields/field_utils.tcc" #endif // FIELD_UTILS_HPP_