updated decode key const to allow use outside crate
HEADmain1 files changed, 3 insertions, 5 deletions
|
|
| @@ -24,10 +24,8 @@ pub use view::*; |
| 24 | pub use ipnet; |
24 | pub use ipnet; |
| 25 | |
25 | |
| 26 | #[doc(hidden)] |
26 | #[doc(hidden)] |
| 27 | pub const fn __decode_wg_key_const( |
27 | pub const fn __decode_wg_key_const(encoded: &str) -> Key { |
| 28 | encoded: &str, |
28 | Key::new_unchecked_from(key::decode_wg_key_const(encoded)) |
| 29 | ) -> [u8; netlink_packet_wireguard::WireguardAttribute::WG_KEY_LEN] { |
| |
| 30 | key::decode_wg_key_const(encoded) |
| |
| 31 | } |
29 | } |
| 32 | |
30 | |
| 33 | /// Creates a [`Key`] from a canonical WireGuard base64 literal at compile time. |
31 | /// Creates a [`Key`] from a canonical WireGuard base64 literal at compile time. |
| @@ -48,7 +46,7 @@ pub const fn __decode_wg_key_const( |
| 48 | #[macro_export] |
46 | #[macro_export] |
| 49 | macro_rules! key { |
47 | macro_rules! key { |
| 50 | ($value:literal) => { |
48 | ($value:literal) => { |
| 51 | $crate::Key::new_unchecked_from($crate::__decode_wg_key_const($value)) |
49 | $crate::__decode_wg_key_const($value) |
| 52 | }; |
50 | }; |
| 53 | } |
51 | } |
| 54 | |
52 | |
|