A Clojure library designed to support 3GPP™ Milenage algorithm calculations according to 3GPP TS 35.206.
OPc
calculation based onOP
andK
f1
-f5
functions includingf1*
andf5*
- Algorithm customization with
R
andC
constants - You can use bundled Rijndael or any other instance of javax.crypto.Cipher
- Create
cipher
javax.crypto.Cipher, it will act as representation of a ciphering keyK
(milenage-clj/create-rijndael-cipher k)
- Create a MilenageConstants record with sample (AKA "default") or your own values.
milenage-clj/sample-milenage-constants ; sample values
(milenage-clj/milenage-constants c-const-map r-const-map) ; your own values
Where c-const-map
is a map of byte arrays with keys {:c1 :c2 :c3 :c4 :c5}
and r-const-map
is a map with byte values and keys {:r1 :r2 :r3 :r4 :r5}
- Calculate
OPc
fromOP
andcipher
(milenage-clj/opc cipher op-bytes)
- Call appropriate Milenage function:
f2-all
->:f1
,:f1*
f2f5
->:f2
,:f5
f3
f4
f5*
You can use test module as an example of usage.
Internally, for a bit arithmetic, module uses a java.math.BigInteger
Copyright © 2015-2016 Constantin Roganov
Distributed under the MIT License.