# aka_algorythm_set.h

Summary

aka_algorythm_set.h |
Variables |
u8 | type for a byte
Functions |
f1 | Computes network authentication code MAC-A from key K, random challenge RAND, sequence number SQN and authentication management field AMF.
f2345 | Takes key K and random challenge RAND, and returns response RES, confidentiality key CK, integrity key IK and anonymity key AK.
f1star | Computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.
f5star | Takes key K and random challenge RAND, and returns resynch anonymity key AK.
ComputeOPc | Function to compute OPc from OP and K.
RijndaelKeySchedule | Rijndael key schedule function.
RijndaelEncrypt | Rijndael encryption function.
KeyAdd | Round key addition function
ByteSub | Byte substitution transformation
ShiftRow | Row shift transformation
MixColumn | MixColumn transformation

### Variables

### u8

#### Purpose

type for a byte

### Functions

### f1

#### Purpose

Computes network authentication code MAC-A from key K, random challenge RAND, sequence number SQN and authentication management field AMF.

#### Parameters

k | in unsigned char - key
rand | in unsigned char - random challenge
sqn | in unsigned char - sequence number
amf | in unsigned char - authentication management field
mac_a | out unsigned char - network authentication code

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f2345

#### Purpose

Takes key K and random challenge RAND, and returns response RES, confidentiality key CK, integrity key IK and anonymity key AK.

#### Parameters

k | in unsigned char - key
rand | in unsigned char - random challenge
res | out unsigned char - response
ck | out unsigned char - confidentiality key
ik | out unsigned char - integrity key
ak | out unsigned char - anonymity key

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f1star

#### Purpose

Computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.

#### Parameters

k | in unsigned char - key
rand | in unsigned char - random challenge
sqn | in unsigned char - sequence number
amf | in unsigned char - authentication management field
mac_s | out unsigned char - resynch authentication code

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f5star

#### Purpose

Takes key K and random challenge RAND, and returns resynch anonymity key AK.

#### Parameters

k | in unsigned char - key
rand | in unsigned char - random challenge
ak | out unsigned char - resynch anonymity key AK

#### Return Value

-

#### Errors

-

#### Detailed description

-

### ComputeOPc

#### Purpose

Function to compute OPc from OP and K. Assumes key schedule has already been performed.

#### Parameters

op_c | in unsigned char -

#### Return Value

-

#### Errors

-

#### Detailed description

-

### RijndaelKeySchedule

#### Purpose

Rijndael key schedule function. Takes 16-byte key and creates all Rijndael’s internal subkeys ready for encryption.

#### Parameters

key | in unsigned char - key

#### Return Value

-

#### Errors

-

#### Detailed description

-

### RijndaelEncrypt

#### Purpose

Rijndael encryption function. Takes 16-byte input and creates 16-byte output (using round keys already derived from 16-byte key).

#### Parameters

input | in unsigned char - input
output | in unsigned char - output

#### Return Value

-

#### Errors

-

#### Detailed description

-

### KeyAdd

#### Purpose

Round key addition function

#### Parameters

state | in unsigned char -
roundKeys | in unsigned char -
round | in unsigned char -

#### Return Value

-

#### Errors

-

#### Detailed description

-

### ByteSub

#### Purpose

Byte substitution transformation

#### Parameters

state | in unsigned char -

#### Return Value

-

#### Errors

-

#### Detailed description

-

### ShiftRow

#### Purpose

Row shift transformation

#### Parameters

state | in unsigned char -

#### Return Value

-

#### Errors

-

#### Detailed description

-

### MixColumn

#### Purpose

MixColumn transformation

#### Parameters

state | in unsigned char -

#### Return Value

-

#### Errors

-

#### Detailed description

-