libosmogsm  0.9.6.270-38c0
Osmocom GSM library
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
GSM A5 ciphering algorithm

Files

file  a5.h
 Osmocom GSM A5 ciphering algorithm header.
 

Functions

static uint32_t osmo_a5_fn_count (uint32_t fn)
 Converts a frame number into the 22 bit number used in A5/x. More...
 
int osmo_a5 (int n, const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul)
 Main method to generate a A5/x cipher stream. More...
 
void osmo_a5_1 (const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul) OSMO_DEPRECATED("Use generic osmo_a5() instead")
 
void osmo_a5_2 (const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul) OSMO_DEPRECATED("Use generic osmo_a5() instead")
 

Detailed Description

Function Documentation

int osmo_a5 ( int  n,
const uint8_t *  key,
uint32_t  fn,
ubit_t *  dl,
ubit_t *  ul 
)

Main method to generate a A5/x cipher stream.

Parameters
[in]nWhich A5/x method to use
[in]key8 or 16 (for a5/4) byte array for the key (as received from the SIM)
[in]fnFrame number
[out]dlPointer to array of ubits to return Downlink cipher stream
[out]ulPointer to array of ubits to return Uplink cipher stream
Returns
0 for success, -ENOTSUP for invalid cipher selection.

Currently A5/[0-4] are supported. Either (or both) of dl/ul can be NULL if not needed.

References _a5_1(), _a5_2(), _a5_3(), and _a5_4().

static uint32_t osmo_a5_fn_count ( uint32_t  fn)
inlinestatic

Converts a frame number into the 22 bit number used in A5/x.

Parameters
[in]fnThe true framenumber
Returns
22 bit word

Referenced by _a5_1(), _a5_2(), and _a5_4().