channel/channel.rs
1use hop_core::{field::Field, CompanionMatrix, StreamGenerator};
2
3fn main() {
4 // Example coefficients for recurrence: x^3 + 2x^2 + 3x + 4
5 let coeffs = vec![4, 3, 2];
6 let cm = CompanionMatrix::from_coeffs(&coeffs);
7
8 // Example polynomial for T: g(x) = 1 + 2x
9 let g_coeffs = vec![1, 2];
10 let t = StreamGenerator::build_t_from_poly(&cm, &g_coeffs);
11
12 // Initial state vector
13 let state = vec![Field::new(1), Field::new(0), Field::new(0)];
14
15 let mut sg = StreamGenerator::new(cm, t, state);
16
17 // Generate and print first 10 outputs
18 for _ in 0..10 {
19 let output = sg.step();
20 println!("{:?}", output);
21 }
22}