nicolas

Crates.ionicolas
lib.rsnicolas
version0.1.1
sourcesrc
created_at2019-06-09 06:32:40.956054
updated_at2019-06-10 00:32:08.256962
descriptionComputational Algebra Library
homepagehttps://github.com/shinnya/nicolas
repositoryhttps://github.com/shinnya/nicolas
max_upload_size
id139918
size24,124
Shinya Yamaoka (shinnya)

documentation

README

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();
Commit count: 0

cargo fmt