Struct cyfs_base::AesKey

source ·
pub struct AesKey(_);

Implementations§

source§

impl AesKey

source

pub fn len(&self) -> usize

source

pub fn to_base58(&self) -> String

source

pub fn from_base58(s: &str) -> BuckyResult<Self>

source

pub fn proxy(n: u64) -> AesKey

source

pub fn random() -> AesKey

source

pub fn mix_hash(&self, salt: Option<u64>) -> KeyMixHash

source

pub fn padded_len(in_len: usize) -> usize

source

pub fn encrypt( &self, in_buf: &[u8], out: &mut [u8], in_len: usize ) -> Result<usize, BuckyError>

source

pub fn decrypt( &self, in_buf: &[u8], out: &mut [u8], in_len: usize ) -> Result<usize, BuckyError>

source

pub fn inplace_encrypt( &self, inout: &mut [u8], in_len: usize ) -> Result<usize, BuckyError>

source

pub fn inplace_decrypt( &self, inout: &mut [u8], in_len: usize ) -> Result<usize, BuckyError>

source

pub fn as_slice(&self) -> &[u8]

source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Trait Implementations§

source§

impl AsRef<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for AesKey

source§

fn as_ref(&self) -> &GenericArray<u8, U48>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for AesKey

source§

fn clone(&self) -> AesKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AesKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AesKey

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for AesKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&[u8; 48]> for AesKey

source§

fn from(v: &[u8; 48]) -> Self

Converts to this type from the input type.
source§

impl From<AesKey> for GenericArray<u8, U48>

source§

fn from(aes_key: AesKey) -> Self

Converts to this type from the input type.
source§

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for AesKey

source§

fn from(aes_key: GenericArray<u8, U48>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8, Global>> for AesKey

source§

fn from(v: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl FromStr for AesKey

§

type Err = BuckyError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<AesKey> for AesKey

source§

fn eq(&self, other: &AesKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'de> RawDecode<'de> for AesKey

source§

fn raw_decode(buf: &'de [u8]) -> BuckyResult<(Self, &'de [u8])>

source§

fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption ) -> BuckyResult<(Self, &'de [u8])>

source§

impl RawDiff for AesKey

source§

fn diff_measure(&self, right: &Self) -> BuckyResult<usize>

source§

fn diff<'d>(&self, right: &Self, buf: &'d mut [u8]) -> BuckyResult<&'d mut [u8]>

source§

impl RawEncode for AesKey

source§

fn raw_measure(&self, _purpose: &Option<RawEncodePurpose>) -> BuckyResult<usize>

source§

fn raw_encode<'a>( &self, buf: &'a mut [u8], _purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a mut [u8]>

source§

fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>

source§

fn raw_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>

source§

fn raw_hash_value(&self) -> BuckyResult<HashValue>

source§

fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue

source§

fn raw_hash_encode(&self) -> BuckyResult<Vec<u8>>

source§

impl RawFixedBytes for AesKey

source§

impl<'de> RawPatch<'de> for AesKey

source§

fn patch(self, buf: &'de [u8]) -> BuckyResult<(Self, &'de [u8])>

source§

impl Eq for AesKey

source§

impl StructuralEq for AesKey

source§

impl StructuralPartialEq for AesKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V