fn parse(buf: &[u8]) -> Result<Tai64N, WireGuardError> {
        if buf.len() < 12 {
            return Err(WireGuardError::InvalidTai64nTimestamp);
        }

        let secs = u64::from_be_bytes(make_array(&buf[0..]));
        let nano = u32::from_be_bytes(make_array(&buf[8..]));

        // wireguard does not actually expect tai64n timestamp, just monotonically increasing one
        //if secs < (1u64 << 62) || secs >= (1u64 << 63) {
        //    return Err(WireGuardError::InvalidTai64nTimestamp);
        //};
        //if nano >= 1_000_000_000 {
        //   return Err(WireGuardError::InvalidTai64nTimestamp);
        //}

        Ok(Tai64N { secs, nano })
    }
// Parse a timestamp from a 12 byte u8 slice
Parse a timestamp from a 12 byte u8 slice
Parse a timestamp from a 12 byte u8 slice
fn parse(buf: &[u8]) -> Result<Tai64N, WireGuardError> {
        if buf.len() < 12 {
            return Err(WireGuardError::InvalidTai64nTimestamp);
        }
        let secs = u64::from_be_bytes(make_array(&buf[0..]));
        let nano = u32::from_be_bytes(make_array(&buf[8..]));
        // wireguard does not actually expect tai64n timestamp, just monotonically increasing one
        //if secs < (1u64 << 62) || secs >= (1u64 << 63) {
        //    return Err(WireGuardError::InvalidTai64nTimestamp);
        //};
        //if nano >= 1_000_000_000 {
        //   return Err(WireGuardError::InvalidTai64nTimestamp);
        //}
        Ok(Tai64N { secs, nano })
    }
fn parse ( buf : & [ u8 ] ) -> Result < Tai64N , WireGuardError > { if buf . len ( ) < 12 { return Err ( WireGuardError :: InvalidTai64nTimestamp ) ; } let secs = u64 :: from_be_bytes ( make_array ( & buf [ 0 .. ] ) ) ; let nano = u32 :: from_be_bytes ( make_array ( & buf [ 8 .. ] ) ) ; // wireguard does not actually expect tai64n timestamp, just monotonically increasing one //if secs < (1u64 << 62) || secs >= (1u64 << 63) { //    return Err(WireGuardError::InvalidTai64nTimestamp); //}; //if nano >= 1_000_000_000 { //   return Err(WireGuardError::InvalidTai64nTimestamp); //} Ok ( Tai64N { secs , nano } ) }
Parse a timestamp from a 12 byte u8 slice
Parse a timestamp from a 12 byte u8 slice
buf
&[u8]
buf
&[u8]