Trait lpn::codes::BinaryCode[][src]

pub trait BinaryCode {
    fn name(&self) -> String;
fn length(&self) -> usize;
fn dimension(&self) -> usize;
fn generator_matrix(&self) -> &BinMatrix;
fn parity_check_matrix(&self) -> &BinMatrix;
fn decode_to_message(&self, c: &BinVector) -> Result<BinVector, &str>; fn decode_to_code(&self, c: &BinVector) -> Result<BinVector, &str> { ... }
fn encode(&self, c: &BinVector) -> BinVector { ... }
fn decode_sample(&self, c: &mut Sample) { ... }
fn decode_slice(&self, c: &mut [u64]) { ... }
fn bias(&self, delta: f64) -> f64 { ... } }

Generic binary linear code API

Required methods

fn name(&self) -> String[src]

Name of the code

fn length(&self) -> usize[src]

Length of the code

fn dimension(&self) -> usize[src]

Dimension of the code

fn generator_matrix(&self) -> &BinMatrix[src]

Generator Matrix

fn parity_check_matrix(&self) -> &BinMatrix[src]

Parity check matrix

fn decode_to_message(&self, c: &BinVector) -> Result<BinVector, &str>[src]

Decode a codeword to the message space

Loading content...

Provided methods

fn decode_to_code(&self, c: &BinVector) -> Result<BinVector, &str>[src]

Decode a codeword to the codeword space

fn encode(&self, c: &BinVector) -> BinVector[src]

Encode a codeword

fn decode_sample(&self, c: &mut Sample)[src]

fn decode_slice(&self, c: &mut [u64])[src]

fn bias(&self, delta: f64) -> f64[src]

Get or compute the bc of a code

Loading content...

Trait Implementations

impl Debug for dyn BinaryCode[src]

impl Serialize for &dyn BinaryCode[src]

Implementors

impl BinaryCode for IdentityCode[src]

impl BinaryCode for RepetitionCode[src]

fn bias(&self, delta: f64) -> f64[src]

Directly compute the bias of repetition codes using the formulae of Bogos / Tramer / Vaudenay (2015)

https://eprint.iacr.org/2015/049

impl<'codes> BinaryCode for ConcatenatedCode<'codes>[src]

Loading content...