Crypto

## Functions

static | LLIST_HEAD (gprs_ciphers)
int | gprs_cipher_register (struct gprs_cipher_impl *ciph)
int | gprs_cipher_load (const char *path)
int | gprs_cipher_run (uint8_t *out, uint16_t len, enum gprs_ciph_algo algo, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction dir)
unsigned | gprs_cipher_key_length (enum gprs_ciph_algo algo)
| Obtain key lenght for given GPRS cipher. More...
int | gprs_cipher_supported (enum gprs_ciph_algo algo)
uint32_t | gprs_cipher_gen_input_ui (uint32_t iov_ui, uint8_t sapi, uint32_t lfn, uint32_t oc)
uint32_t | gprs_cipher_gen_input_i (uint32_t iov_i, uint32_t lfn, uint32_t oc)
static | __attribute__ ((constructor))

## Variables

static struct gprs_cipher_impl * | selected_ciphers [_GPRS_ALGO_NUM]
const struct value_string | gprs_cipher_names []
static struct gprs_cipher_impl | gea3_impl
static struct gprs_cipher_impl | gea4_impl

## Detailed Description

## Function Documentation

## __attribute__()

static __attribute__ | ( | (constructor) |  | ) |

static

References gea3_impl, gea4_impl, and gprs_cipher_register().

## gprs_cipher_gen_input_i()

uint32_t gprs_cipher_gen_input_i | ( | uint32_t | iov_i,
|  | uint32_t | lfn,
|  | uint32_t | oc
| ) |  |

## gprs_cipher_gen_input_ui()

uint32_t gprs_cipher_gen_input_ui | ( | uint32_t | iov_ui,
|  | uint8_t | sapi,
|  | uint32_t | lfn,
|  | uint32_t | oc
| ) |  |

## gprs_cipher_key_length()

unsigned gprs_cipher_key_length | ( | enum gprs_ciph_algo | algo | ) |

Obtain key lenght for given GPRS cipher.

Parameters

  [in] | algo | Enum representive GPRS cipher

Returns
  unsigned integer key length for supported algorithms, for GEA0 and unknown ciphers will return 0

References GPRS_ALGO_GEA0, GPRS_ALGO_GEA1, GPRS_ALGO_GEA2, GPRS_ALGO_GEA3, and GPRS_ALGO_GEA4.

Referenced by gea3().

## gprs_cipher_load()

int gprs_cipher_load | ( | const char * | path | ) |

## gprs_cipher_register()

int gprs_cipher_register | ( | struct gprs_cipher_impl * | ciph | ) |

References gprs_cipher_impl::algo, gprs_cipher_impl::list, gprs_cipher_impl::priority, and selected_ciphers.

Referenced by __attribute__().

## gprs_cipher_run()

int gprs_cipher_run | ( | uint8_t * | out,
|  | uint16_t | len,
|  | enum gprs_ciph_algo | algo,
|  | uint8_t * | kc,
|  | uint32_t | iv,
|  | enum gprs_cipher_direction | dir
| ) |  |

References GSM0464_CIPH_MAX_BLOCK, len, gprs_cipher_impl::run, and selected_ciphers.

## gprs_cipher_supported()

int gprs_cipher_supported | ( | enum gprs_ciph_algo | algo | ) |

References selected_ciphers.

## LLIST_HEAD()

static LLIST_HEAD | ( | gprs_ciphers |  | ) |

static

## Variable Documentation

## gea3_impl

struct gprs_cipher_impl gea3_impl

static

Initial value:
= {
.algo = GPRS_ALGO_GEA3,
.name = "GEA3 (libosmogsm built-in)",
.priority = 100,
.run = &gea3,
}

Referenced by __attribute__().

## gea4_impl

struct gprs_cipher_impl gea4_impl

static

Initial value:
= {
.algo = GPRS_ALGO_GEA4,
.name = "GEA4 (libosmogsm built-in)",
.priority = 100,
.run = &gea4,
}

Referenced by __attribute__().

## gprs_cipher_names

const struct value_string gprs_cipher_names[]

Initial value:
= {
{ GPRS_ALGO_GEA0, "GEA0" },
{ GPRS_ALGO_GEA1, "GEA1" },
{ GPRS_ALGO_GEA2, "GEA2" },
{ GPRS_ALGO_GEA3, "GEA3" },
{ GPRS_ALGO_GEA4, "GEA4" },
{ 0, NULL },
}

## selected_ciphers

struct gprs_cipher_impl* selected_ciphers[_GPRS_ALGO_NUM]

static

Referenced by gprs_cipher_register(), gprs_cipher_run(), and gprs_cipher_supported().

GPRS_ALGO_GEA4
@ GPRS_ALGO_GEA4
Definition: gprs_cipher.h:18
gea3
int gea3(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction direct)
Performs the GEA3 algorithm as in 3GPP TS 55.216 V6.2.0.
Definition: gea.c:55
GPRS_ALGO_GEA3
@ GPRS_ALGO_GEA3
Definition: gprs_cipher.h:17
GPRS_ALGO_GEA0
@ GPRS_ALGO_GEA0
Definition: gprs_cipher.h:14
gea4
int gea4(uint8_t *out, uint16_t len, uint8_t *kc, uint32_t iv, enum gprs_cipher_direction direct)
Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0.
Definition: gea.c:41
GPRS_ALGO_GEA1
@ GPRS_ALGO_GEA1
Definition: gprs_cipher.h:15
GPRS_ALGO_GEA2
@ GPRS_ALGO_GEA2
Definition: gprs_cipher.h:16