diff options
author | Kevin Redon <kevredon@mail.tsaitgaist.info> | 2013-11-02 18:11:01 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2013-11-03 15:05:25 +0100 |
commit | be355cd78a5aac7d11c1b9234254537b3c55f2d5 (patch) | |
tree | 55ca95451e9721886ac1f3b675fa7d38ee89797d /include/osmocom | |
parent | 3d557b18d099249b0d60ea91c72695a678c9465f (diff) |
implement COMP128 version 2 and 3 A3/A8 algorithm
simple copy into C from reversed code from www.hackingprojects.net
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/gsm/comp128v23.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/osmocom/gsm/comp128v23.h b/include/osmocom/gsm/comp128v23.h new file mode 100644 index 00000000..aa26e56a --- /dev/null +++ b/include/osmocom/gsm/comp128v23.h @@ -0,0 +1,23 @@ +/* + * COMP128v23 header + * + * See comp128v23.c for details + */ + +#ifndef __COMP128V23_H__ +#define __COMP128V23_H__ + +#include <stdint.h> + +/* + * Performs the COMP128 version 2 and 3 algorithm (used as A3/A8) + * ki : uint8_t [16] + * srand : uint8_t [16] + * version : uint8_t (2 or 3) + * sres : uint8_t [4] + * kc : uint8_t [8] + * returns 1 if not version 2 or 3 specified + */ +int comp128v23(const uint8_t *ki, const uint8_t *rand, uint8_t version, uint8_t *sres, uint8_t *kc); + +#endif /* __COMP128V23_H__ */ |