1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![no_std]

pub struct And<A, B>(pub A, pub B);

macro_rules! define {
    ( $( pub struct $name:ident / $lower:ident ( pub $ty:ty ) ; )* ) => {
        $(
            #[repr(transparent)]
            #[derive(Clone)]
            pub struct $name(pub $ty);

            pub fn $lower(target: &$ty) -> &$name {
                // unsafe { ::core::mem::transmute(target) }
                unsafe { &*(target as *const $ty as *const $name) }
            }
        )*
    };
}


pub mod sha2;
pub mod hmac;
pub mod poly1305;
pub mod chacha20;
pub mod salsa20;
pub mod chacha20poly1305;
pub mod ed25519;
pub mod curve25519;
pub mod nacl;