Skip to content

Prime field #47

Open
Open
@vherbert

Description

@vherbert

Hi,

I would like to employ your lib with prime field as possible. But doc is missing, I obtain strange behaviour with my usage.

#include <cstdint>
#include <stdexcept>
#include <libff/algebra/fields/fp.hpp>

using namespace std;

const mp_size_t limbcount = 4;
libff::bigint<limbcount> mod= libff::bigint<limbcount>("21888242871839275222246405745257275088548364400416034343698204186575808495617");
typedef libff::Fp_model<limbcount, mod> FieldT;

int main()
{
	assert(FieldT::modulus_is_valid());
	FieldT x = FieldT::random_element();
	FieldT y = FieldT::one();
	FieldT z = x + y;
	mod.print();
	x.print();
	y.print();
	z.print();
        FieldT::one().print()
	assert(FieldT::zero() != FieldT::one());	
}

fail

Help would be appreciated. Thanks.

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions