3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * Description: Implementation of the A5/1 stream cipher algorithm, as used in GSM.
25 * ! Warning, this is weak crypto !
40 /* 3-Bit word parity lookup table (Byte)
53 #define PARITY_LOOKUP 0x96
56 /* we are wasting one byte here but this allows a much faster implementation */
57 uint8_t r1[3], r2[3], r3[3]; /* the three regs, 19,22,23 bit in length */
60 void a5_1_init(a5_1_ctx_t *c, void *key, uint8_t keylength_b, void *iv,
62 uint8_t a5_1_clock(a5_1_ctx_t *c);
63 uint8_t a5_1_gen(a5_1_ctx_t *c);