Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file milenage.h |
| 2 | * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208). |
| 3 | */ |
Harald Welte | 781bd5d | 2011-12-06 22:23:52 +0100 | [diff] [blame] | 4 | /* |
Harald Welte | 781bd5d | 2011-12-06 22:23:52 +0100 | [diff] [blame] | 5 | * Copyright (c) 2006-2007 <j@w1.fi> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * Alternatively, this software may be distributed under the terms of BSD |
| 12 | * license. |
| 13 | * |
Harald Welte | e08da97 | 2017-11-13 01:00:26 +0900 | [diff] [blame] | 14 | * SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause |
| 15 | * |
Harald Welte | 781bd5d | 2011-12-06 22:23:52 +0100 | [diff] [blame] | 16 | * See README and COPYING for more details. |
| 17 | */ |
| 18 | |
Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 19 | #pragma once |
Harald Welte | 781bd5d | 2011-12-06 22:23:52 +0100 | [diff] [blame] | 20 | |
| 21 | void milenage_generate(const u8 *opc, const u8 *amf, const u8 *k, |
| 22 | const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik, |
| 23 | u8 *ck, u8 *res, size_t *res_len); |
| 24 | int milenage_auts(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, |
| 25 | u8 *sqn); |
| 26 | int gsm_milenage(const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres, |
| 27 | u8 *kc); |
| 28 | int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand, |
| 29 | const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len, |
| 30 | u8 *auts); |
| 31 | int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand, |
| 32 | const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s); |
| 33 | int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand, |
| 34 | u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar); |
| 35 | |
Harald Welte | 042afe7 | 2012-03-21 08:19:47 +0100 | [diff] [blame] | 36 | int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op); |