Rust edition bump.

This commit is contained in:
Adam Ierymenko 2021-12-07 11:31:31 -05:00
parent 9b71b354b0
commit 018889d3b4
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
4 changed files with 21 additions and 3 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "zerotier-core-crypto"
version = "0.1.0"
edition = "2018"
edition = "2021"
license = "MPL-2.0"
authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]

View file

@ -52,3 +52,21 @@ pub fn concat_4_slices<const S0: usize, const S1: usize, const S2: usize, const
pub fn concat_4_arrays<const S0: usize, const S1: usize, const S2: usize, const S3: usize, const S: usize>(s0: &[u8; S0], s1: &[u8; S1], s2: &[u8; S2], s3: &[u8; S3]) -> [u8; S] {
concat_4_slices::<S0, S1, S2, S3, S>(s0, s1, s2, s3)
}
#[inline(always)]
pub fn concat_5_slices<const S0: usize, const S1: usize, const S2: usize, const S3: usize, const S4: usize, const S: usize>(s0: &[u8], s1: &[u8], s2: &[u8], s3: &[u8], s4: &[u8]) -> [u8; S] {
debug_assert_eq!(S0 + S1 + S2 + S3 + S4, S);
let mut tmp: [u8; S] = unsafe { MaybeUninit::uninit().assume_init() };
tmp[..S0].copy_from_slice(s0);
tmp[S0..S1].copy_from_slice(s1);
tmp[(S0 + S1)..(S0 + S1 + S2)].copy_from_slice(s2);
tmp[(S0 + S1 + S2)..(S0 + S1 + S2 + S3)].copy_from_slice(s3);
tmp[(S0 + S1 + S2 + S3)..].copy_from_slice(s4);
tmp
}
#[inline(always)]
pub fn concat_5_arrays<const S0: usize, const S1: usize, const S2: usize, const S3: usize, const S4: usize, const S: usize>(s0: &[u8; S0], s1: &[u8; S1], s2: &[u8; S2], s3: &[u8; S3], s4: &[u8; S4]) -> [u8; S] {
concat_5_slices::<S0, S1, S2, S3, S4, S>(s0, s1, s2, s3, s4)
}

View file

@ -1,7 +1,7 @@
[package]
name = "zerotier-network-hypervisor"
version = "2.0.0"
edition = "2018"
edition = "2021"
license = "MPL-2.0"
authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]

View file

@ -2,7 +2,7 @@
name = "zerotier-system-service"
version = "0.1.0"
authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]
edition = "2018"
edition = "2021"
license = "MPL-2.0"
[profile.release]