https://github.com/acmo0/lfsr-fibo
Efficient pure Rust implementation of LFSR in Fibonacci representation
https://github.com/acmo0/lfsr-fibo
cryptography lfsr lightweight-cryptography random-generation
Last synced: 8 months ago
JSON representation
Efficient pure Rust implementation of LFSR in Fibonacci representation
- Host: GitHub
- URL: https://github.com/acmo0/lfsr-fibo
- Owner: acmo0
- License: mit
- Created: 2025-09-10T09:11:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-10T09:16:56.000Z (9 months ago)
- Last Synced: 2025-09-10T12:57:02.552Z (9 months ago)
- Topics: cryptography, lfsr, lightweight-cryptography, random-generation
- Language: Rust
- Homepage: https://crates.io/crates/lfsr-fibo
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lfsr-fibo


Efficient pure Rust implementation of LFSR in fibonacci representation.
Please see installation details and doc on [crates.io](https://crates.io/crates/lfsr-fibo).
***
## Usage
This is an example of a basic usage. Let say that you want to generate 256 bits from the LFSR represented by the polynomial `x^11 + x^6 + x^3 + 1` with an initial state of `10101101110`, then you can use this crate in the folowing way :
```rust
use std::collections::VecDeque;
use lfsr_fibo::Lfsr;
fn main() {
let mut lfsr = Lfsr::new(vec![11, 6, 3]);
lfsr.set_key(VecDeque::from([1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0]));
let mut generated: Vec = vec![];
for _i in 0..256 {
generated.push(lfsr.clock());
}
println!("Generated : {:?}", generated);
}