mirror of
https://github.com/mii443/RustySecrets.git
synced 2025-08-22 16:25:32 +00:00
Note algorithm in encode_secret_byte docstring
This commit is contained in:
committed by
Romain Ruetschi
parent
73e45bf032
commit
8bf1c8bf54
@ -2,7 +2,8 @@ use gf256::Gf256;
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
|
|
||||||
/// evaluates a polynomial at x=1, 2, 3, ... n (inclusive)
|
/// Evaluates a polynomial at x=1, 2, 3, ... n (inclusive) using
|
||||||
|
/// Horner's method.
|
||||||
pub(crate) fn encode_secret_byte<W: Write>(src: &[u8], n: u8, w: &mut W) -> io::Result<()> {
|
pub(crate) fn encode_secret_byte<W: Write>(src: &[u8], n: u8, w: &mut W) -> io::Result<()> {
|
||||||
for raw_x in 1..(u16::from(n) + 1) {
|
for raw_x in 1..(u16::from(n) + 1) {
|
||||||
let x = Gf256::from_byte(raw_x as u8);
|
let x = Gf256::from_byte(raw_x as u8);
|
||||||
|
Reference in New Issue
Block a user