[PATCH] remove comp128 from public API - use osmocom/crypt/auth.h instead

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/baseband-devel@lists.osmocom.org/.

Max Suraev Max.Suraev at fairwaves.co
Mon Jun 16 16:35:23 UTC 2014


Signed-off-by: Max Suraev <Max.Suraev at fairwaves.co>
---
 include/Makefile.am           | 6 +++---
 include/osmocom/gsm/comp128.h | 4 ++--
 src/gsm/auth_comp128v1.c      | 2 +-
 src/gsm/comp128.c             | 2 +-
 src/gsm/libosmogsm.map        | 1 -
 tests/comp128/comp128_test.c  | 1 -
 6 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 74396de..47f5e4f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -45,8 +45,6 @@ nobase_include_HEADERS = \
                        osmocom/gprs/protocol/gsm_08_18.h \
                        osmocom/gsm/a5.h \
                        osmocom/gsm/abis_nm.h \
-                       osmocom/gsm/comp128.h \
-                       osmocom/gsm/comp128v23.h \
                        osmocom/gsm/gan.h \
                        osmocom/gsm/gsm0411_smc.h \
                        osmocom/gsm/gsm0411_smr.h \
@@ -110,7 +108,9 @@ endif
 
 noinst_HEADERS = \
 	osmocom/core/timer_compat.h \
-	osmocom/gsm/kasumi.h
+	osmocom/gsm/kasumi.h \
+	osmocom/gsm/comp128.h \
+	osmocom/gsm/comp128v23.h \
 
 osmocom/core/bit%gen.h: osmocom/core/bitXXgen.h.tpl
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@)
diff --git a/include/osmocom/gsm/comp128.h b/include/osmocom/gsm/comp128.h
index 33b997a..c45da37 100644
--- a/include/osmocom/gsm/comp128.h
+++ b/include/osmocom/gsm/comp128.h
@@ -9,10 +9,10 @@
 #include <stdint.h>
 
 /*
- * Performs the COMP128 algorithm (used as A3/A8)
+ * Performs the COMP128v1 algorithm (used as A3/A8)
  * ki    : uint8_t [16]
  * srand : uint8_t [16]
  * sres  : uint8_t [4]
  * kc    : uint8_t [8]
  */
-void comp128(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc);
+void comp128v1(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc);
diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c
index 41aef71..c40027e 100644
--- a/src/gsm/auth_comp128v1.c
+++ b/src/gsm/auth_comp128v1.c
@@ -28,7 +28,7 @@ static int c128v1_gen_vec(struct osmo_auth_vector *vec,
 			  struct osmo_sub_auth_data *aud,
 			  const uint8_t *_rand)
 {
-	comp128(aud->u.gsm.ki, _rand, vec->sres, vec->kc);
+	comp128v1(aud->u.gsm.ki, _rand, vec->sres, vec->kc);
 	vec->auth_types = OSMO_AUTH_TYPE_GSM;
 
 	return 0;
diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c
index b7a2382..e36c20d 100644
--- a/src/gsm/comp128.c
+++ b/src/gsm/comp128.c
@@ -185,7 +185,7 @@ _comp128_permutation(uint8_t *x, uint8_t *bits)
 }
 
 void
-comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
+comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
 {
 	int i;
 	uint8_t x[32], bits[128];
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index cab4fc4..daad5bb 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -23,7 +23,6 @@ abis_nm_test_name;
 
 osmo_sitype_strs;
 
-comp128;
 dbm2rxlev;
 
 gprs_cipher_gen_input_i;
diff --git a/tests/comp128/comp128_test.c b/tests/comp128/comp128_test.c
index eb6fb12..d6a6401 100644
--- a/tests/comp128/comp128_test.c
+++ b/tests/comp128/comp128_test.c
@@ -6,7 +6,6 @@
 
 #include <osmocom/core/bits.h>
 #include <osmocom/core/utils.h>
-#include <osmocom/gsm/comp128v23.h>
 #include <osmocom/crypt/auth.h>
 
 static struct osmo_sub_auth_data test_aux2 = {
-- 
1.9.1





More information about the baseband-devel mailing list