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

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 bias(&self, delta: f64) -> f64 { ... } }

Generic binary linear code API

Required methods

fn name(&self) -> String

Name of the code

fn length(&self) -> usize

Length of the code

fn dimension(&self) -> usize

Dimension of the code

fn generator_matrix(&self) -> &BinMatrix

Generator Matrix

fn parity_check_matrix(&self) -> &BinMatrix

Parity check matrix

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

Decode a codeword to the message space

Loading content...

Provided methods

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

Decode a codeword to the codeword space

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

Encode a codeword

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

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 BogosrndCode18_6[src]

impl BinaryCode for BogosrndCode19_6[src]

impl BinaryCode for BogosrndCode19_7[src]

impl BinaryCode for CustomCode5_3[src]

impl BinaryCode for GolayCode23_12[src]

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

We know how to give the bias directly for this code

impl BinaryCode for GolayCode24_12[src]

impl BinaryCode for HammingCode127_120[src]

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

We know how to give the bias directly for this code

impl BinaryCode for HammingCode15_11[src]

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

Encode using lookup table

impl BinaryCode for HammingCode31_26[src]

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

We know how to give the bias directly for this code

impl BinaryCode for HammingCode3_1[src]

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

Encode using lookup table

impl BinaryCode for HammingCode63_57[src]

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

We know how to give the bias directly for this code

impl BinaryCode for HammingCode7_4[src]

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

Encode using lookup table

impl BinaryCode for IdentityCode[src]

impl BinaryCode for MdsCode3_2[src]

impl BinaryCode for MdsCode4_3[src]

impl BinaryCode for MdsCode5_4[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]

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

Loading content...