aboutsummaryrefslogtreecommitdiff
path: root/src/mem/types.rs
blob: ed22132b1aa74891a1726a9a434af27e06b8197b (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// # u256 struct
///
/// 256 bit size field
#[derive(Copy, Clone)]
pub struct U256(u128, u128);
impl U256 {
    pub const fn new() -> Self {
        U256(0, 0)
    }
}

/// # u512 struct
///
/// 512 bit size field
#[derive(Copy, Clone)]
pub struct U512(U256, U256);
impl U512 {
    pub const fn new() -> Self {
        U512(U256::new(), U256::new())
    }
}

/// # u1024 struct
///
/// 1024 bit size field
#[derive(Copy, Clone)]
pub struct U1024(U512, U512);
impl U1024 {
    pub const fn new() -> Self {
        U1024(U512::new(), U512::new())
    }
}

/// # u2048 struct
///
/// 2048 bit size field
#[derive(Copy, Clone)]
pub struct U2048(U1024, U1024);
impl U2048 {
    pub const fn new() -> Self {
        U2048(U1024::new(), U1024::new())
    }
}

/// # u4096 struct
///
/// 4096 bit size field
#[derive(Copy, Clone)]
pub struct U4096(U2048, U2048);
impl U4096 {
    pub const fn new() -> Self {
        U4096(U2048::new(), U2048::new())
    }
}