libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Functions
tuak.h File Reference
`#include <stdint.h>`

Go to the source code of this file.

## Functions
int | tuak_f1 (const uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *_rand, const uint8_t *sqn, const uint8_t *amf, uint8_t *mac_a, uint8_t mac_a_len_bytes, unsigned int keccac_iterations)
| tuak_f1 - TUAK f1 algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128-bit or 256-bit subscriber key @_rand: RAND = 128-bit random challenge @sqn: SQN = 48-bit sequence number @amf: AMF = 16-bit authentication management field @mac_a: Buffer for MAC-A = 64/128/256-bit network authentication code Returns: 0 on success, -1 on failure More...
int | tuak_f1star (const uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *_rand, const uint8_t *sqn, const uint8_t *amf, uint8_t *mac_s, uint8_t mac_s_len_bytes, unsigned int keccac_iterations)
| tuak_f1star - TUAK f1* algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128-bit or 256-bit subscriber key @_rand: RAND = 128-bit random challenge @sqn: SQN = 48-bit sequence number @amf: AMF = 16-bit authentication management field @mac_s: Buffer for MAC-S = 64/128/256-bit resync authentication code Returns: 0 on success, -1 on failure More...
int | tuak_f2345 (const uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *_rand, uint8_t *res, uint8_t res_len_bytes, uint8_t *ck, uint8_t ck_len_bytes, uint8_t *ik, uint8_t ik_len_bytes, uint8_t *ak, unsigned int keccac_iterations)
| tuak_f2345 - TUAK f2, f3, f4, f5, algorithms @opc: OPc = 256-bit value derived from OP and K @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @res: Buffer for RES = 32/64/128/256-bit signed response (f2), or NULL @ck: Buffer for CK = 128/256-bit confidentiality key (f3), or NULL @ik: Buffer for IK = 128/256-bit integrity key (f4), or NULL @ak: Buffer for AK = 48-bit anonymity key (f5), or NULL Returns: 0 on success, -1 on failure More...
int | tuak_f5star (const uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *_rand, uint8_t *ak, unsigned int keccac_iterations)
| tuak_f5star - TUAK f5* algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @ak: Buffer for AK = 48-bit anonymity key (f5) Returns: 0 on success, -1 on failure More...
void | tuak_set_keccak_iterations (unsigned int i)
void | tuak_generate (const uint8_t *opc, const uint8_t *amf, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *sqn, const uint8_t *_rand, uint8_t *autn, uint8_t *ik, uint8_t *ck, uint8_t *res, size_t *res_len)
| tuak_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 256-bit operator variant algorithm configuration field (encr.) @amf: AMF = 16-bit authentication management field @k: K = 128/256-bit subscriber key @sqn: SQN = 48-bit sequence number @_rand: RAND = 128-bit random challenge @autn: Buffer for AUTN = 128-bit authentication token @ik: Buffer for IK = 128/256-bit integrity key (f4), or NULL @ck: Buffer for CK = 128/256-bit confidentiality key (f3), or NULL @res: Buffer for RES = 32/64/128-bit signed response (f2), or NULL @res_len: Max length for res; set to used length or 0 on failure More...
int | tuak_auts (const uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *_rand, const uint8_t *auts, uint8_t *sqn)
| tuak_auts - Milenage AUTS validation @opc: OPc = 256-bit operator variant algorithm configuration field (encr.) @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @auts: AUTS = 112-bit authentication token from client @sqn: Buffer for SQN = 48-bit sequence number Returns: 0 = success (sqn filled), -1 on failure More...
int | tuak_opc_gen (uint8_t *opc, const uint8_t *k, uint8_t k_len_bytes, const uint8_t *op)

## Function Documentation

## ◆ tuak_auts()

int tuak_auts | ( | const uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | _rand,
|  | const uint8_t * | auts,
|  | uint8_t * | sqn
| ) |  |

tuak_auts - Milenage AUTS validation @opc: OPc = 256-bit operator variant algorithm configuration field (encr.) @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @auts: AUTS = 112-bit authentication token from client @sqn: Buffer for SQN = 48-bit sequence number Returns: 0 = success (sqn filled), -1 on failure

References g_keccak_iterations, tuak_f1star(), and tuak_f5star().

Referenced by tuak_gen_vec_auts().

## ◆ tuak_f1()

int tuak_f1 | ( | const uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | _rand,
|  | const uint8_t * | sqn,
|  | const uint8_t * | amf,
|  | uint8_t * | mac_a,
|  | uint8_t | mac_a_len_bytes,
|  | unsigned int | keccac_iterations
| ) |  |

tuak_f1 - TUAK f1 algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128-bit or 256-bit subscriber key @_rand: RAND = 128-bit random challenge @sqn: SQN = 48-bit sequence number @amf: AMF = 16-bit authentication management field @mac_a: Buffer for MAC-A = 64/128/256-bit network authentication code Returns: 0 on success, -1 on failure

References memcpy_reverse(), and tuak_core().

Referenced by tuak_generate().

## ◆ tuak_f1star()

int tuak_f1star | ( | const uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | _rand,
|  | const uint8_t * | sqn,
|  | const uint8_t * | amf,
|  | uint8_t * | mac_s,
|  | uint8_t | mac_s_len_bytes,
|  | unsigned int | keccac_iterations
| ) |  |

tuak_f1star - TUAK f1* algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128-bit or 256-bit subscriber key @_rand: RAND = 128-bit random challenge @sqn: SQN = 48-bit sequence number @amf: AMF = 16-bit authentication management field @mac_s: Buffer for MAC-S = 64/128/256-bit resync authentication code Returns: 0 on success, -1 on failure

References memcpy_reverse(), and tuak_core().

Referenced by tuak_auts().

## ◆ tuak_f2345()

int tuak_f2345 | ( | const uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | _rand,
|  | uint8_t * | res,
|  | uint8_t | res_len_bytes,
|  | uint8_t * | ck,
|  | uint8_t | ck_len_bytes,
|  | uint8_t * | ik,
|  | uint8_t | ik_len_bytes,
|  | uint8_t * | ak,
|  | unsigned int | keccac_iterations
| ) |  |

tuak_f2345 - TUAK f2, f3, f4, f5, algorithms @opc: OPc = 256-bit value derived from OP and K @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @res: Buffer for RES = 32/64/128/256-bit signed response (f2), or NULL @ck: Buffer for CK = 128/256-bit confidentiality key (f3), or NULL @ik: Buffer for IK = 128/256-bit integrity key (f4), or NULL @ak: Buffer for AK = 48-bit anonymity key (f5), or NULL Returns: 0 on success, -1 on failure

References memcpy_reverse(), res, tuak_core(), and zero16.

Referenced by tuak_generate().

## ◆ tuak_f5star()

int tuak_f5star | ( | const uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | _rand,
|  | uint8_t * | ak,
|  | unsigned int | keccac_iterations
| ) |  |

tuak_f5star - TUAK f5* algorithm @opc: OPc = 256-bit value derived from OP and K @k: K = 128/256-bit subscriber key @_rand: RAND = 128-bit random challenge @ak: Buffer for AK = 48-bit anonymity key (f5) Returns: 0 on success, -1 on failure

References memcpy_reverse(), tuak_core(), and zero16.

Referenced by tuak_auts().

## ◆ tuak_generate()

void tuak_generate | ( | const uint8_t * | opc,
|  | const uint8_t * | amf,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | sqn,
|  | const uint8_t * | _rand,
|  | uint8_t * | autn,
|  | uint8_t * | ik,
|  | uint8_t * | ck,
|  | uint8_t * | res,
|  | size_t * | res_len
| ) |  |

tuak_generate - Generate AKA AUTN,IK,CK,RES @opc: OPc = 256-bit operator variant algorithm configuration field (encr.) @amf: AMF = 16-bit authentication management field @k: K = 128/256-bit subscriber key @sqn: SQN = 48-bit sequence number @_rand: RAND = 128-bit random challenge @autn: Buffer for AUTN = 128-bit authentication token @ik: Buffer for IK = 128/256-bit integrity key (f4), or NULL @ck: Buffer for CK = 128/256-bit confidentiality key (f3), or NULL @res: Buffer for RES = 32/64/128-bit signed response (f2), or NULL @res_len: Max length for res; set to used length or 0 on failure

References g_keccak_iterations, res, tuak_f1(), and tuak_f2345().

Referenced by tuak_gen_vec().

## ◆ tuak_opc_gen()

int tuak_opc_gen | ( | uint8_t * | opc,
|  | const uint8_t * | k,
|  | uint8_t | k_len_bytes,
|  | const uint8_t * | op
| ) |  |

References g_keccak_iterations, memcpy_reverse(), tuak_core(), and zero16.

Referenced by gen_opc_if_needed().

## ◆ tuak_set_keccak_iterations()

void tuak_set_keccak_iterations | ( | unsigned int | i | ) |

References g_keccak_iterations.