diff options
author | Eric <ewild@sysmocom.de> | 2021-05-19 17:45:38 +0200 |
---|---|---|
committer | Eric <ewild@sysmocom.de> | 2021-06-08 02:38:15 +0200 |
commit | c3fa007610b66bb491184f15080a254c6dd0e8f1 (patch) | |
tree | ae5ec99664bb42824b4728d09db269cd4ffac311 /include/osmocom | |
parent | e9fd81a5c31782f36b512cf41ee98d0a4e4a82eb (diff) |
kdf: add key derivation functions
generic sha code from git://w1.fi/hostap.git commit
5ea93947ca67ba83529798b806a15b247cdb2e93 which also happens
to be the source of our milenage code.
Related: SYS#5324
Change-Id: Ibf2e49edada944d91ceba62bd0d6b6ce69261fcd
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/crypt/kdf.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/osmocom/crypt/kdf.h b/include/osmocom/crypt/kdf.h new file mode 100644 index 00000000..4a3b3b2e --- /dev/null +++ b/include/osmocom/crypt/kdf.h @@ -0,0 +1,21 @@ +#pragma once + +/*! \defgroup kdf key derivation functions + * @{ + * \file kdf.h */ + +#include <stdint.h> + +void osmo_kdf_kc128(const uint8_t* ck, const uint8_t* ik, uint8_t* kc128); + +void osmo_kdf_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 osmo_kdf_enb(const uint8_t *kasme, uint32_t ul_count, uint8_t *kenb); + +void osmo_kdf_nh(const uint8_t *kasme, const uint8_t *sync_input, uint8_t *nh); + +void osmo_kdf_nas(uint8_t algo_type, uint8_t algo_id, const uint8_t *kasme, uint8_t *knas); + + +/* @} */ |