[PATCH] Cleanup SQN code, use generic functions

Signed-off-by: Max Suraev <Max.Suraev@fairwaves.co>
---
 src/gsm/auth_milenage.c | 35 +++--------------------------------
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c
index 5b2787d..1635ac6 100644
--- a/src/gsm/auth_milenage.c
+++ b/src/gsm/auth_milenage.c
@@ -21,39 +21,10 @@
  */

 #include <osmocom/crypt/auth.h>
+#include <osmocom/core/bits.h>
 #include "milenage/common.h"
 #include "milenage/milenage.h"

-static void sqn_u64_to_48bit(uint8_t *sqn, const uint64_t sqn64)
-{
-	sqn[5] = (sqn64 >>  0) & 0xff;
-	sqn[4] = (sqn64 >>  8) & 0xff;
-	sqn[3] = (sqn64 >> 16) & 0xff;
-	sqn[2] = (sqn64 >> 24) & 0xff;
-	sqn[1] = (sqn64 >> 32) & 0xff;
-	sqn[0] = (sqn64 >> 40) & 0xff;
-}
-
-static uint64_t sqn_48bit_to_u64(const uint8_t *sqn)
-{
-	uint64_t sqn64;
(Continue reading)

Re: [PATCH] Cleanup SQN code, use generic functions

Just a small code simplification due to use of generic functions, covered by test suite.

--

-- 
best regards,
Max, http://fairwaves.co