package polynomial

  1. Overview
  2. Docs
Polynomials over finite fields

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-polynomial-0.4.0.tar.gz
md5=0ec793314441a5a1106cdf57d1e09304
sha512=1b474604c31c152d0539f912c08fac0c41d61da0ffd27270f37d7121e851ac9cc4f03ca3bb061da266039189a92d4fb50eb0d366ade5814b62cfa03289310515

Description

Polynomials over finite fields

Published: 24 Nov 2022

README

ocaml-polynomial

Play with polynomial

Examples

Let's have an example with fields

opam switch create . 4.09.1
opam install . -y --with-test --deps-only
opam install . -y
opam install utop
dune utop
#require "ff";
module F379 = Ff.MakeFp(struct let prime_order = Z.of_int 379 end);;
module Poly379 = Polynomial.Make(F379);;
let points =
  [ (F379.of_string "2", F379.of_string "3");
    (F379.of_string "0", F379.of_string "1") ]
in
let interpolated_polynomial = Poly.lagrange_interpolation points in
assert (
  Poly.equal
    (Poly.of_coefficients
       [ (F379.of_string "1", 1);
         (F379.of_string "1", 0) ])
    interpolated_polynomial )

JavaScript compatibility

This library can be transpiled in JavaScript using js_of_ocaml. An example is provided in js/test_js.ml, with the corresponding dune file.

How to help

Install merlin and ocamlformat.0.15.0

opam install merlin ocamlformat.0.15.0

Install

opam install polynomial

Coverage

opam install bisect_ppx -y
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html

Dependencies (3)

  1. ff-sig >= "0.6.1" & < "0.7.0"
  2. zarith >= "1.9.1" & < "2.0.0"
  3. dune >= "2.7"

Dev Dependencies (6)

  1. zarith_stubs_js with-test
  2. js_of_ocaml-ppx with-test
  3. js_of_ocaml with-test
  4. bisect_ppx with-test & >= "2.5.0"
  5. ff with-test & >= "0.6.1" & < "0.7.0"
  6. alcotest with-test

Used by (2)

  1. tezos-bls12-381-polynomial >= "1.0.0"
  2. tezos-plompiler >= "1.0.0"

Conflicts

None

OCaml

Innovation. Community. Security.