aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/crypt/gprs_cipher.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom/crypt/gprs_cipher.h')
-rw-r--r--include/osmocom/crypt/gprs_cipher.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h
index 940b07b1..d6edefaf 100644
--- a/include/osmocom/crypt/gprs_cipher.h
+++ b/include/osmocom/crypt/gprs_cipher.h
@@ -9,6 +9,7 @@ enum gprs_ciph_algo {
GPRS_ALGO_GEA1,
GPRS_ALGO_GEA2,
GPRS_ALGO_GEA3,
+ GPRS_ALGO_GEA4,
_GPRS_ALGO_NUM
};
@@ -27,7 +28,7 @@ struct gprs_cipher_impl {
/* As specified in 04.64 Annex A. Uses Kc, IV and direction
* to generate the 1523 bytes cipher stream that need to be
* XORed wit the plaintext for encrypt / ciphertext for decrypt */
- int (*run)(uint8_t *out, uint16_t len, uint64_t kc, uint32_t iv,
+ int (*run)(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv,
enum gprs_cipher_direction direction);
};
@@ -39,11 +40,14 @@ int gprs_cipher_load(const char *path);
/* function to be called by core code */
int gprs_cipher_run(uint8_t *out, uint16_t len, enum gprs_ciph_algo algo,
- uint64_t kc, uint32_t iv, enum gprs_cipher_direction dir);
+ uint8_t *kc, uint32_t iv, enum gprs_cipher_direction dir);
/* Do we have an implementation for this cipher? */
int gprs_cipher_supported(enum gprs_ciph_algo algo);
+/* Return key length for supported cipher, in bytes */
+unsigned gprs_cipher_key_length(enum gprs_ciph_algo algo);
+
/* GSM TS 04.64 / Section A.2.1 : Generation of 'input' */
uint32_t gprs_cipher_gen_input_ui(uint32_t iov_ui, uint8_t sapi, uint32_t lfn, uint32_t oc);