nicolas 0.1.1

Computational Algebra Library
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented0 out of 12 items with examples
  • Size
  • Source code size: 25.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.89 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • shinnya

nicolas

Example

use nicolas::galois::{GenGF2E, GF2E, Poly2};

// Declares the irreducible polynomial. Here it's x^4 + x + 1.
let p = Poly2::new(0b10011)

// 8 means that use GF(2^4). 
let g = GenGF2E::new(4, p);

// Generates a new element(x) of GF(2^4).
let a = g.gen(Poly2::new(0b10));

// Generates a new element(x) of GF(2^4).
let b = g.gen(Poly2::new(0b10));

// Addition
let _ = a + b;

// Subtraction
let _ = a - b;

// Multiply
let _ = a * b;

// Converts to u64
let _ = a.as_u64();