pub struct Milenage {
pub ak: Option<[u8; 6]>,
pub ck: Option<[u8; 16]>,
pub ik: Option<[u8; 16]>,
pub k: [u8; 16],
pub maca: Option<[u8; 8]>,
pub macs: Option<[u8; 8]>,
pub op: Option<[u8; 16]>,
pub opc: [u8; 16],
pub res: Option<[u8; 8]>,
pub res_star: Option<[u8; 16]>,
}
Expand description
Milenage instance
Fields§
§ak: Option<[u8; 6]>
AK is a 48-bit anonymity key that is the output of either of the functions f5.
ck: Option<[u8; 16]>
CK is a 128-bit confidentiality key that is the output of the function f3.
ik: Option<[u8; 16]>
IK is a 128-bit integrity key that is the output of the function f4.
k: [u8; 16]
K is a 128-bit subscriber key that is an input to the functions f1, f1*, f2, f3, f4, f5 and f5*.
maca: Option<[u8; 8]>
MACA is a 64-bit network authentication code that is the output of the function f1.
macs: Option<[u8; 8]>
MACS is a 64-bit resynchronisation authentication code that is the output of the function f1*.
op: Option<[u8; 16]>
OP is a 128-bit Operator Variant Algorithm Configuration Field that is a component of the functions f1, f1*, f2, f3, f4, f5 and f5*.
opc: [u8; 16]
OPc is a 128-bit value derived from OP and K and used within the computation of the functions.
res: Option<[u8; 8]>
RES is a 64-bit signed response that is the output of the function f2.
res_star: Option<[u8; 16]>
RES* is a 128-bit response that is used in 5G.
Implementations§
source§impl Milenage
impl Milenage
sourcepub fn new_with_op(k: [u8; 16], op: [u8; 16]) -> Milenage
pub fn new_with_op(k: [u8; 16], op: [u8; 16]) -> Milenage
Returns a new initialized Milenage from K and OP
sourcepub fn new_with_opc(k: [u8; 16], opc: [u8; 16]) -> Milenage
pub fn new_with_opc(k: [u8; 16], opc: [u8; 16]) -> Milenage
Returns a new initialized Milenage from K and OPc
sourcepub fn f1(&mut self, rand: &[u8; 16], sqn: &[u8; 6], amf: &[u8; 2]) -> [u8; 8]
pub fn f1(&mut self, rand: &[u8; 16], sqn: &[u8; 6], amf: &[u8; 2]) -> [u8; 8]
F1 is the network authentication function. F1 computes network authentication code MAC-A from key K, random challenge RAND, sequence number SQN and authentication management field AMF.
sourcepub fn f1star(
&mut self,
rand: &[u8; 16],
sqn: &[u8; 6],
amf: &[u8; 2]
) -> [u8; 8]
pub fn f1star( &mut self, rand: &[u8; 16], sqn: &[u8; 6], amf: &[u8; 2] ) -> [u8; 8]
F1Star is the re-synchronisation message authentication function. F1Star computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.
sourcepub fn f2345(
&mut self,
rand: &[u8; 16]
) -> ([u8; 8], [u8; 16], [u8; 16], [u8; 6])
pub fn f2345( &mut self, rand: &[u8; 16] ) -> ([u8; 8], [u8; 16], [u8; 16], [u8; 6])
F2345 takes key K and random challenge RAND, and returns response RES, confidentiality key CK, integrity key IK and anonymity key AK.