| Crates.io | algebraic_immunity |
| lib.rs | algebraic_immunity |
| version | 0.2.0 |
| created_at | 2025-07-01 14:29:59.590289+00 |
| updated_at | 2025-07-01 14:42:53.96625+00 |
| description | A package to compute the algebrac immunity of Boolean functions. |
| homepage | https://github.com/LucaBonamino/algebraic_immunity_rs |
| repository | https://github.com/LucaBonamino/algebraic_immunity_rs |
| max_upload_size | |
| id | 1733264 |
| size | 22,196 |
A Rust library to compute the algebraic immunity of Boolean functions.
Add the dependency to your Cargo.toml:
[dependencies]
algebraic_immunity = "0.1.0"
use algebraic_immunity::ai::AlgebraicImmunity;
let ve = vec![0,1,0,0];
let immunity = AlgebraicImmunity::algebraic_immunity(ve, 2;
assert_eq!(immunity, 5);
use algebraic_immunity::ai::AlgebraicImmunity;
let ve = vec![
1,0,1,0,0,0,1,1,1,1,0,1,0,0,1,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,
1,0,0,1,1,0,0,1,0,0,1,1,0,1,1,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,0,1,0,0,1,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,
1,0,1,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,1,1,0,1,1,0,0,0,1,0,1,0,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,1,0,1,0,1,
0,1,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,0,1,0,1,1,0,0,0,1,0,0,0,1,0,0,1,1,1,1,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,
1,0,0,1,0,1,1,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,0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