A Clojure library designed to support 3GPP™ Milenage algorithm calculations according to 3GPP TS 35.206.
OPccalculation based onOPandKf1-f5functions includingf1*andf5*- Algorithm customization with
RandCconstants - You can use bundled Rijndael or any other instance of javax.crypto.Cipher
- Create
cipherjavax.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 valuesWhere 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
OPcfromOPandcipher
(milenage-clj/opc cipher op-bytes)- Call appropriate Milenage function:
f2-all->:f1,:f1*f2f5->:f2,:f5f3f4f5*
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.