Trait false_bottom::Encode
source · pub trait Encode {
// Required methods
fn to_bytes(&self) -> (Vec<u8>, Vec<u8>);
fn from_bytes(cipher: &[u8], keybase: &[u8]) -> Result<Self, FbError>
where Self: Sized;
}
Expand description
Provides methods to encode and decode data to and from several formats.
Required Methods§
sourcefn to_bytes(&self) -> (Vec<u8>, Vec<u8>)
fn to_bytes(&self) -> (Vec<u8>, Vec<u8>)
Returns the byte representation of the ciphertext and keybase.
sourcefn from_bytes(cipher: &[u8], keybase: &[u8]) -> Result<Self, FbError>where
Self: Sized,
fn from_bytes(cipher: &[u8], keybase: &[u8]) -> Result<Self, FbError>where
Self: Sized,
Constructs the FbObj
from the provided byte representations of
ciphertext and keybase.
§Errors
- InvalidParams - Are the parameters in the wrong order?