A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
Functions | Variables
firecode.c File Reference

Implementation of first encoding phase: Fire code (CRC) More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "utils.h"
#include "firecode.h"
#include "const_code.h"

Functions

void processFireGMatrix (byte G[FIRE_SOURCE_LENGTH][FIRE_CODE_LENGTH])
 Calculates the encoding matrix corresponding to the Fire encoding step.
void processFireHMatrix (byte H[FIRE_CRC_LENGTH][FIRE_CODE_LENGTH], byte G[FIRE_SOURCE_LENGTH][FIRE_CODE_LENGTH])
 Calculates the parity-check matrix H corresponding to the Fire encoding step from the Fire encoding matrix G.
void reverseFire (byte in[FIRE_CODE_LENGTH], byte out[FIRE_SOURCE_LENGTH])
 Decodes a previously Fire-encoded message.

Variables

char polynomial [FIRE_POLYNOMIAL_LENGTH] = {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1}
 Bit Representation of the Fire polynomial.
char polynomial_mirrored [FIRE_POLYNOMIAL_LENGTH] = {1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1}
 Bit mirrored representation of the Fire polynomial.

Detailed Description

Implementation of first encoding phase: Fire code (CRC)

Author:
Nicolas Paglieri & Olivier Benjamin
Version:
File Revision #9
Date:
24/06/2011

Function Documentation

void processFireGMatrix ( byte  G[FIRE_SOURCE_LENGTH][FIRE_CODE_LENGTH])

Calculates the encoding matrix corresponding to the Fire encoding step.

Parameters:
[out]GFire encoding matrix

References FIRE_CODE_LENGTH, FIRE_SOURCE_LENGTH, and polynomial_mirrored.

Referenced by processFullEncodingGMatrix(), and reverseFire().

void processFireHMatrix ( byte  H[FIRE_CRC_LENGTH][FIRE_CODE_LENGTH],
byte  G[FIRE_SOURCE_LENGTH][FIRE_CODE_LENGTH] 
)

Calculates the parity-check matrix H corresponding to the Fire encoding step from the Fire encoding matrix G.

Parameters:
[out]HFire parity-check matrix
[in]GFire encoding matrix

References FIRE_CRC_LENGTH, and FIRE_SOURCE_LENGTH.

Referenced by reverseFire().

void reverseFire ( byte  in[FIRE_CODE_LENGTH],
byte  out[FIRE_SOURCE_LENGTH] 
)

Decodes a previously Fire-encoded message.

Parameters:
[in]inFire-encoded data to decode
[out]outDecoded data

References DEBUG_INFO, DUMP_CHAR_VECTOR, FIRE_CODE_LENGTH, FIRE_CRC_LENGTH, FIRE_SOURCE_LENGTH, processFireGMatrix(), and processFireHMatrix().

Referenced by processFullDecoding().