Note algorithm in encode_secret_byte docstring

This commit is contained in:
Noah Vesely
2018-03-15 15:57:02 -06:00
committed by Romain Ruetschi
parent 73e45bf032
commit 8bf1c8bf54

View File

@ -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);