mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 21:13:44 +02:00
adding macos
This commit is contained in:
parent
3751397655
commit
c8cb45128e
3 changed files with 6 additions and 25 deletions
|
@ -135,14 +135,7 @@ mod fruit_flavored {
|
|||
assert_eq!(data.len(), 16);
|
||||
unsafe {
|
||||
let mut data_out_written = 0;
|
||||
CCCryptorUpdate(
|
||||
self.0,
|
||||
data.as_ptr().cast(),
|
||||
16,
|
||||
data.as_mut_ptr().cast(),
|
||||
16,
|
||||
&mut data_out_written,
|
||||
);
|
||||
CCCryptorUpdate(self.0, data.as_ptr().cast(), 16, data.as_mut_ptr().cast(), 16, &mut data_out_written);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,14 +161,7 @@ mod fruit_flavored {
|
|||
assert_eq!(data.len(), 16);
|
||||
unsafe {
|
||||
let mut data_out_written = 0;
|
||||
CCCryptorUpdate(
|
||||
self.1,
|
||||
data.as_ptr().cast(),
|
||||
16,
|
||||
data.as_mut_ptr().cast(),
|
||||
16,
|
||||
&mut data_out_written,
|
||||
);
|
||||
CCCryptorUpdate(self.1, data.as_ptr().cast(), 16, data.as_mut_ptr().cast(), 16, &mut data_out_written);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -357,15 +343,9 @@ mod fruit_flavored {
|
|||
pub fn crypt_in_place(&mut self, data: &mut [u8]) {
|
||||
unsafe {
|
||||
if self.1 {
|
||||
assert_eq!(
|
||||
CCCryptorGCMEncrypt(self.0, data.as_ptr().cast(), data.len(), data.as_mut_ptr().cast()),
|
||||
0
|
||||
);
|
||||
assert_eq!(CCCryptorGCMEncrypt(self.0, data.as_ptr().cast(), data.len(), data.as_mut_ptr().cast()), 0);
|
||||
} else {
|
||||
assert_eq!(
|
||||
CCCryptorGCMDecrypt(self.0, data.as_ptr().cast(), data.len(), data.as_mut_ptr().cast()),
|
||||
0
|
||||
);
|
||||
assert_eq!(CCCryptorGCMDecrypt(self.0, data.as_ptr().cast(), data.len(), data.as_mut_ptr().cast()), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ mod ec;
|
|||
pub mod aes_gmac_siv;
|
||||
pub mod secret;
|
||||
pub mod random;
|
||||
pub mod aes;
|
||||
pub mod hash;
|
||||
pub mod mimcvdf;
|
||||
pub mod p384;
|
||||
|
@ -17,6 +16,8 @@ pub mod salsa;
|
|||
pub mod typestate;
|
||||
pub mod x25519;
|
||||
|
||||
pub mod aes;
|
||||
|
||||
|
||||
/// This must be called before using any function from this library.
|
||||
pub fn init() {
|
||||
|
|
Loading…
Add table
Reference in a new issue