// Copyright (c) Silence Laboratories Pte. Ltd. All Rights Reserved.
// This software is licensed under the Silence Laboratories License Agreement.
usestd::ops::Deref;/// Domain separation lavbel
pubstructLabel([u8; 8]);constLABEL_BITS:usize=48;implAsRef<[u8]>forLabel{fnas_ref(&self)->&[u8]{&self.0}}implDeref forLabel{typeTarget=[u8];fnderef(&self)->&Self::Target{&self.0}}implLabel{/// Create a new label.
pubconstfnnew(ver:u16, label:u64)->Self{assert!(label <(1<<LABEL_BITS));let label =((ver asu64)<<LABEL_BITS)| label;Self(label.to_be_bytes())}}