pub struct CryptoSystemVLD0 { /* private fields */ }
Expand description

V0 CryptoSystem

Implementations§

source§

impl CryptoSystemVLD0

source

pub fn new(crypto: Crypto) -> Self

Trait Implementations§

source§

impl Clone for CryptoSystemVLD0

source§

fn clone(&self) -> CryptoSystemVLD0

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 CryptoSystem for CryptoSystemVLD0

source§

fn kind(&self) -> CryptoKind

source§

fn crypto(&self) -> Crypto

source§

fn cached_dh( &self, key: &PublicKey, secret: &SecretKey ) -> VeilidAPIResult<SharedSecret>

source§

fn random_bytes(&self, len: u32) -> Vec<u8>

source§

fn default_salt_length(&self) -> u32

source§

fn hash_password(&self, password: &[u8], salt: &[u8]) -> VeilidAPIResult<String>

source§

fn verify_password( &self, password: &[u8], password_hash: &str ) -> VeilidAPIResult<bool>

source§

fn derive_shared_secret( &self, password: &[u8], salt: &[u8] ) -> VeilidAPIResult<SharedSecret>

source§

fn random_nonce(&self) -> Nonce

source§

fn random_shared_secret(&self) -> SharedSecret

source§

fn compute_dh( &self, key: &PublicKey, secret: &SecretKey ) -> VeilidAPIResult<SharedSecret>

source§

fn generate_keypair(&self) -> KeyPair

source§

fn generate_hash(&self, data: &[u8]) -> PublicKey

source§

fn generate_hash_reader( &self, reader: &mut dyn Read ) -> VeilidAPIResult<PublicKey>

source§

fn validate_keypair( &self, dht_key: &PublicKey, dht_key_secret: &SecretKey ) -> bool

source§

fn validate_hash(&self, data: &[u8], dht_key: &PublicKey) -> bool

source§

fn validate_hash_reader( &self, reader: &mut dyn Read, dht_key: &PublicKey ) -> VeilidAPIResult<bool>

source§

fn distance(&self, key1: &PublicKey, key2: &PublicKey) -> CryptoKeyDistance

source§

fn sign( &self, dht_key: &PublicKey, dht_key_secret: &SecretKey, data: &[u8] ) -> VeilidAPIResult<Signature>

source§

fn verify( &self, dht_key: &PublicKey, data: &[u8], signature: &Signature ) -> VeilidAPIResult<()>

source§

fn aead_overhead(&self) -> usize

source§

fn decrypt_in_place_aead( &self, body: &mut Vec<u8>, nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]> ) -> VeilidAPIResult<()>

source§

fn decrypt_aead( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]> ) -> VeilidAPIResult<Vec<u8>>

source§

fn encrypt_in_place_aead( &self, body: &mut Vec<u8>, nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]> ) -> VeilidAPIResult<()>

source§

fn encrypt_aead( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]> ) -> VeilidAPIResult<Vec<u8>>

source§

fn crypt_in_place_no_auth( &self, body: &mut [u8], nonce: &[u8; 24], shared_secret: &SharedSecret )

source§

fn crypt_b2b_no_auth( &self, in_buf: &[u8], out_buf: &mut [u8], nonce: &[u8; 24], shared_secret: &SharedSecret )

source§

fn crypt_no_auth_aligned_8( &self, in_buf: &[u8], nonce: &[u8; 24], shared_secret: &SharedSecret ) -> Vec<u8>

source§

fn crypt_no_auth_unaligned( &self, in_buf: &[u8], nonce: &[u8; 24], shared_secret: &SharedSecret ) -> Vec<u8>

source§

fn generate_shared_secret( &self, key: &PublicKey, secret: &SecretKey, domain: &[u8] ) -> VeilidAPIResult<SharedSecret>

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more