pub struct Ipcrypt { /* private fields */ }Expand description
A structure representing the IPCrypt context for deterministic mode.
Implementations§
Source§impl Ipcrypt
impl Ipcrypt
Sourcepub fn generate_key() -> [u8; 16]
pub fn generate_key() -> [u8; 16]
Generates a new random key for encryption.
Sourcepub fn new(key: [u8; 16]) -> Self
pub fn new(key: [u8; 16]) -> Self
Creates a new Ipcrypt instance with the given key.
§Arguments
key- A 16-byte array containing the encryption key.
Sourcepub fn new_random() -> Self
pub fn new_random() -> Self
Creates a new Ipcrypt instance with a random key.
Sourcepub fn encrypt_ip16(&self, ip: &mut [u8; 16])
pub fn encrypt_ip16(&self, ip: &mut [u8; 16])
Encrypts a 16-byte IP address in place.
Sourcepub fn decrypt_ip16(&self, ip: &mut [u8; 16])
pub fn decrypt_ip16(&self, ip: &mut [u8; 16])
Decrypts a 16-byte IP address in place.
Sourcepub fn encrypt_ipaddr(&self, ip: IpAddr) -> IpAddr
pub fn encrypt_ipaddr(&self, ip: IpAddr) -> IpAddr
Auto Trait Implementations§
impl Freeze for Ipcrypt
impl RefUnwindSafe for Ipcrypt
impl Send for Ipcrypt
impl Sync for Ipcrypt
impl Unpin for Ipcrypt
impl UnwindSafe for Ipcrypt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more