Crates.io | milenage |
lib.rs | milenage |
version | 0.1.4 |
source | src |
created_at | 2020-02-13 14:44:18.539503 |
updated_at | 2023-03-25 20:54:50.166623 |
description | MILENAGE Algorithm Set |
homepage | |
repository | https://github.com/olivierlemoal/milenage-rs/ |
max_upload_size | |
id | 208026 |
size | 20,077 |
MILENAGE authentication algorithm as proposed by ETSI SAGE for 3G authentication.
See 3GPP TS 35.205 (General), 3GPP TS 35.206 (Algorithm specification) and 3GPP TS 35.208 (Design conformance test data).
#[macro_use]
extern crate hex_literal;
extern crate milenage;
use milenage::Milenage;
fn main() {
// Use Test set 2 from 3GPP 35.208
let k = hex!("465b5ce8b199b49faa5f0a2ee238a6bc");
let op = hex!("cdc202d5123e20f62b6d676ac72cb318");
let rand = hex!("23553cbe9637a89d218ae64dae47bf35");
let mut m = Milenage::new_with_op(k, op);
let (res, ck, ik, ak) = m.f2345(&rand);
assert_eq!(m.res.unwrap(), hex!("a54211d5e3ba50bf"));
// or
assert_eq!(res, hex!("a54211d5e3ba50bf"));
assert_eq!(ck, hex!("b40ba9a3c58b2a05bbf0d987b21bf8cb"));
assert_eq!(ik, hex!("f769bcd751044604127672711c6d3441"));
assert_eq!(ak, hex!("aa689c648370"));
}