aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/comp128v23.h
blob: 31d393350eadd8cc0f385efc3b4528b68bd98c0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * COMP128v23 header
 *
 * See comp128v23.c for details
 */

#pragma once

#include <stdint.h>

/*
 * Performs the COMP128 version 2 and 3 algorithm (used as A3/A8)
 * ki    : uint8_t [16]
 * srand : uint8_t [16]
 * sres  : uint8_t [4]
 * kc    : uint8_t [8]
 * returns 1 if not version 2 or 3 specified
 */
int comp128v2(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc);
int comp128v3(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc);