This example illustrates how to use the FAAST::Field::switchContext(), FAAST::FieldElement::toInfrastructure(), FAAST::FieldPolynomial::toInfrastructure() and FAAST::Field::fromInfrastructure() methods.
- Warning
- This is for advanced use only, you shouldn't care about this on an ordinary use of the library.
#include <faast.hpp>
using namespace FAAST;
void main() {
NTL::zz_pX a_polynomial, another_polynomial;
...
NTL::zz_pE an_element = NTL::to_zz_pE(a_polynomial);
NTL::zz_pE another_element = NTL::to_zz_pE(another_polynomial);
c *= b;
NTL::zz_pE yet_another_element;
L.switchContext();
NTL:zz_pX yet_another_polynomial = NTL::rep(yet_another_element);
NTL::LeftShift(yet_another_polynomial, yet_another_polynomial, 1);
yet_another_element = NTL::to_zz_pE(yet_another_polynomial);
c = L.fromInfrastructure(yet_another_element);
}