Select Git revision
-
Fredrik Hübinette (Hubbe) authored
Rev: src/acconfig.h:1.14 Rev: src/builtin_functions.c:1.59 Rev: src/builtin_functions.h:1.5 Rev: src/compilation.h:1.4 Rev: src/configure.in:1.149 Rev: src/cpp.c:1.3 Rev: src/docode.c:1.24 Rev: src/docode.h:1.4 Rev: src/gc.c:1.24 Rev: src/interpret.c:1.57 Rev: src/interpret.h:1.16 Rev: src/language.yacc:1.51 Rev: src/las.c:1.40 Rev: src/las.h:1.9 Rev: src/lex.c:1.37 Rev: src/lex.h:1.7 Rev: src/main.c:1.32 Rev: src/modules/Image/blit.c:1.26 Rev: src/modules/Image/colortable.c:1.33 Rev: src/modules/Image/dct.c:1.11 Rev: src/modules/Image/image.c:1.73 Rev: src/modules/Image/matrix.c:1.13 Rev: src/modules/Image/operator.c:1.11 Rev: src/modules/Image/pattern.c:1.11 Rev: src/modules/Image/pnm.c:1.9 Rev: src/modules/Image/polyfill.c:1.18 Rev: src/modules/Image/togif.c:1.29 Rev: src/modules/Image/x.c:1.17 Rev: src/modules/Pipe/pipe.c:1.15 Rev: src/modules/Regexp/glue.c:1.9 Rev: src/modules/_Crypto/cbc.c:1.10 Rev: src/modules/_Crypto/crypto.c:1.24 Rev: src/modules/_Crypto/des.c:1.11 Rev: src/modules/_Crypto/pipe.c:1.11 Rev: src/modules/_Crypto/sha.c:1.9 Rev: src/modules/files/socktest.pike:1.6 Rev: src/modules/system/system.c:1.37 Rev: src/object.c:1.31 Rev: src/object.h:1.13 Rev: src/opcodes.c:1.10 Rev: src/operators.c:1.22 Rev: src/peep.c:1.16 Rev: src/peep.in:1.9 Rev: src/pike_types.c:1.27 Rev: src/pike_types.h:1.6 Rev: src/program.c:1.48 Rev: src/program.h:1.24 Rev: src/program_areas.h:1.2 Rev: src/stralloc.c:1.21 Rev: src/stralloc.h:1.10 Rev: src/svalue.c:1.18 Rev: src/testsuite.in:1.64 Rev: src/threads.c:1.51 Rev: src/threads.h:1.26
Fredrik Hübinette (Hubbe) authoredRev: src/acconfig.h:1.14 Rev: src/builtin_functions.c:1.59 Rev: src/builtin_functions.h:1.5 Rev: src/compilation.h:1.4 Rev: src/configure.in:1.149 Rev: src/cpp.c:1.3 Rev: src/docode.c:1.24 Rev: src/docode.h:1.4 Rev: src/gc.c:1.24 Rev: src/interpret.c:1.57 Rev: src/interpret.h:1.16 Rev: src/language.yacc:1.51 Rev: src/las.c:1.40 Rev: src/las.h:1.9 Rev: src/lex.c:1.37 Rev: src/lex.h:1.7 Rev: src/main.c:1.32 Rev: src/modules/Image/blit.c:1.26 Rev: src/modules/Image/colortable.c:1.33 Rev: src/modules/Image/dct.c:1.11 Rev: src/modules/Image/image.c:1.73 Rev: src/modules/Image/matrix.c:1.13 Rev: src/modules/Image/operator.c:1.11 Rev: src/modules/Image/pattern.c:1.11 Rev: src/modules/Image/pnm.c:1.9 Rev: src/modules/Image/polyfill.c:1.18 Rev: src/modules/Image/togif.c:1.29 Rev: src/modules/Image/x.c:1.17 Rev: src/modules/Pipe/pipe.c:1.15 Rev: src/modules/Regexp/glue.c:1.9 Rev: src/modules/_Crypto/cbc.c:1.10 Rev: src/modules/_Crypto/crypto.c:1.24 Rev: src/modules/_Crypto/des.c:1.11 Rev: src/modules/_Crypto/pipe.c:1.11 Rev: src/modules/_Crypto/sha.c:1.9 Rev: src/modules/files/socktest.pike:1.6 Rev: src/modules/system/system.c:1.37 Rev: src/object.c:1.31 Rev: src/object.h:1.13 Rev: src/opcodes.c:1.10 Rev: src/operators.c:1.22 Rev: src/peep.c:1.16 Rev: src/peep.in:1.9 Rev: src/pike_types.c:1.27 Rev: src/pike_types.h:1.6 Rev: src/program.c:1.48 Rev: src/program.h:1.24 Rev: src/program_areas.h:1.2 Rev: src/stralloc.c:1.21 Rev: src/stralloc.h:1.10 Rev: src/svalue.c:1.18 Rev: src/testsuite.in:1.64 Rev: src/threads.c:1.51 Rev: src/threads.h:1.26
blowfish.c 17.74 KiB
/* blowfish.c
*
* The blowfish block cipher.
*
* For a description of the algorithm, see:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. Pages 336 ff.
*/
/* NOTE: This file is distributed under the GPL, not the LGPL. */
/* nettle, low-level cryptographics library
*
* Copyright (C) 1998, 2001
* Free Software Foundation, Inc, Ray Dassen, Niels Mller
*
* This file is part of GNUPG.
*
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "blowfish.h"
#include "macros.h"
#include <assert.h>
/* Initial keysetup state */
static const struct blowfish_ctx
initial_ctx =
{ /* precomputed S boxes */
{
{
0xD1310BA6,0x98DFB5AC,0x2FFD72DB,0xD01ADFB7,0xB8E1AFED,0x6A267E96,
0xBA7C9045,0xF12C7F99,0x24A19947,0xB3916CF7,0x0801F2E2,0x858EFC16,
0x636920D8,0x71574E69,0xA458FEA3,0xF4933D7E,0x0D95748F,0x728EB658,
0x718BCD58,0x82154AEE,0x7B54A41D,0xC25A59B5,0x9C30D539,0x2AF26013,
0xC5D1B023,0x286085F0,0xCA417918,0xB8DB38EF,0x8E79DCB0,0x603A180E,
0x6C9E0E8B,0xB01E8A3E,0xD71577C1,0xBD314B27,0x78AF2FDA,0x55605C60,
0xE65525F3,0xAA55AB94,0x57489862,0x63E81440,0x55CA396A,0x2AAB10B6,
0xB4CC5C34,0x1141E8CE,0xA15486AF,0x7C72E993,0xB3EE1411,0x636FBC2A,
0x2BA9C55D,0x741831F6,0xCE5C3E16,0x9B87931E,0xAFD6BA33,0x6C24CF5C,
0x7A325381,0x28958677,0x3B8F4898,0x6B4BB9AF,0xC4BFE81B,0x66282193,
0x61D809CC,0xFB21A991,0x487CAC60,0x5DEC8032,0xEF845D5D,0xE98575B1,
0xDC262302,0xEB651B88,0x23893E81,0xD396ACC5,0x0F6D6FF3,0x83F44239,
0x2E0B4482,0xA4842004,0x69C8F04A,0x9E1F9B5E,0x21C66842,0xF6E96C9A,
0x670C9C61,0xABD388F0,0x6A51A0D2,0xD8542F68,0x960FA728,0xAB5133A3,
0x6EEF0B6C,0x137A3BE4,0xBA3BF050,0x7EFB2A98,0xA1F1651D,0x39AF0176,
0x66CA593E,0x82430E88,0x8CEE8619,0x456F9FB4,0x7D84A5C3,0x3B8B5EBE,
0xE06F75D8,0x85C12073,0x401A449F,0x56C16AA6,0x4ED3AA62,0x363F7706,
0x1BFEDF72,0x429B023D,0x37D0D724,0xD00A1248,0xDB0FEAD3,0x49F1C09B,
0x075372C9,0x80991B7B,0x25D479D8,0xF6E8DEF7,0xE3FE501A,0xB6794C3B,
0x976CE0BD,0x04C006BA,0xC1A94FB6,0x409F60C4,0x5E5C9EC2,0x196A2463,
0x68FB6FAF,0x3E6C53B5,0x1339B2EB,0x3B52EC6F,0x6DFC511F,0x9B30952C,
0xCC814544,0xAF5EBD09,0xBEE3D004,0xDE334AFD,0x660F2807,0x192E4BB3,
0xC0CBA857,0x45C8740F,0xD20B5F39,0xB9D3FBDB,0x5579C0BD,0x1A60320A,
0xD6A100C6,0x402C7279,0x679F25FE,0xFB1FA3CC,0x8EA5E9F8,0xDB3222F8,
0x3C7516DF,0xFD616B15,0x2F501EC8,0xAD0552AB,0x323DB5FA,0xFD238760,