|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION) |
|
|
#error "This header cannot be included directly." |
|
|
#endif |
|
|
|
|
|
#ifndef OGS_KDF_H |
|
|
#define OGS_KDF_H |
|
|
|
|
|
#ifdef __cplusplus |
|
|
extern "C" { |
|
|
#endif |
|
|
|
|
|
|
|
|
void ogs_kdf_kausf( |
|
|
uint8_t *ck, uint8_t *ik, |
|
|
char *serving_network_name, uint8_t *autn, |
|
|
uint8_t *kausf); |
|
|
|
|
|
|
|
|
void ogs_kdf_xres_star( |
|
|
uint8_t *ck, uint8_t *ik, |
|
|
char *serving_network_name, uint8_t *rand, |
|
|
uint8_t *xres, size_t xres_len, |
|
|
uint8_t *xres_star); |
|
|
|
|
|
|
|
|
void ogs_kdf_hxres_star(uint8_t *rand, uint8_t *xres_star, uint8_t *hxres_star); |
|
|
|
|
|
|
|
|
void ogs_kdf_kseaf(char *serving_network_name, const uint8_t *kausf, uint8_t *kseaf); |
|
|
|
|
|
|
|
|
void ogs_kdf_kamf(const char *supi, const uint8_t *abba, uint8_t abba_len, |
|
|
const uint8_t *kseaf, uint8_t *kamf); |
|
|
|
|
|
|
|
|
#define OGS_KDF_NAS_ENC_ALG 0x01 |
|
|
#define OGS_KDF_NAS_INT_ALG 0x02 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ogs_kdf_nas_5gs(uint8_t algorithm_type_distinguishers, |
|
|
uint8_t algorithm_identity, const uint8_t *kamf, uint8_t *knas); |
|
|
|
|
|
|
|
|
void ogs_kdf_kgnb_and_kn3iwf(const uint8_t *kamf, uint32_t ul_count, |
|
|
uint8_t access_type_distinguisher, uint8_t *kgnb); |
|
|
|
|
|
|
|
|
void ogs_kdf_nh_gnb(const uint8_t *kamf, uint8_t *sync_input, uint8_t *kgnb); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ogs_kdf_ansi_x963( |
|
|
const uint8_t *z, size_t z_len, const uint8_t *info, size_t info_len, |
|
|
uint8_t *ek, uint8_t *icb, uint8_t *mk); |
|
|
|
|
|
|
|
|
void ogs_auc_kasme(const uint8_t *ck, const uint8_t *ik, |
|
|
const uint8_t *plmn_id, const uint8_t *sqn, const uint8_t *ak, |
|
|
uint8_t *kasme); |
|
|
|
|
|
|
|
|
void ogs_kdf_kenb(const uint8_t *kasme, uint32_t ul_count, uint8_t *kenb); |
|
|
|
|
|
|
|
|
void ogs_kdf_nh_enb(const uint8_t *kasme, const uint8_t *sync_input, uint8_t *kenb); |
|
|
|
|
|
|
|
|
void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers, |
|
|
uint8_t algorithm_identity, const uint8_t *kasme, uint8_t *knas); |
|
|
|
|
|
|
|
|
void ogs_kdf_ck_ik_handover( |
|
|
uint32_t dl_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik); |
|
|
|
|
|
|
|
|
void ogs_kdf_nas_token( |
|
|
uint32_t ul_count, const uint8_t *kasme, uint8_t *nas_token); |
|
|
|
|
|
|
|
|
void ogs_kdf_kasme_idle_mobility(const uint8_t *ck, const uint8_t *ik, |
|
|
uint32_t nonce_ue, uint32_t nonce_mme, uint8_t *kasme); |
|
|
|
|
|
|
|
|
void ogs_kdf_ck_ik_idle_mobility( |
|
|
uint32_t ul_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ogs_kdf_hash_mme( |
|
|
const uint8_t *message, uint32_t message_len, uint8_t *hash_mme); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ogs_auc_sqn( |
|
|
const uint8_t *opc, const uint8_t *k, |
|
|
const uint8_t *rand, const uint8_t *conc_sqn_ms, |
|
|
uint8_t *sqn_ms, uint8_t *mac_s); |
|
|
|
|
|
#ifdef __cplusplus |
|
|
} |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|