BeeCrypt 4.2.1
blowfish.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999, 2000, 2002 X-Way Rights BV
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19
34#ifndef _BLOWFISH_H
35#define _BLOWFISH_H
36
37#include "beecrypt/beecrypt.h"
39
40#define BLOWFISHROUNDS 16
41#define BLOWFISHPSIZE (BLOWFISHROUNDS+2)
42
46#ifdef __cplusplus
48#else
49struct _blowfishParam
50#endif
51{
55 uint32_t p[BLOWFISHPSIZE];
59 uint32_t s[1024];
63 uint32_t fdback[2];
64};
65
66#ifndef __cplusplus
67typedef struct _blowfishParam blowfishParam;
68#endif
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
78
90int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation);
91
100int blowfishSetIV (blowfishParam*, const byte* iv);
101
103int blowfishSetCTR (blowfishParam*, const byte* nivz, size_t counter);
104
114int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*);
115
125int blowfishDecrypt (blowfishParam*, uint32_t*, const uint32_t*);
126
129
130#ifdef __cplusplus
131}
132#endif
133
134#endif
#define BEECRYPTAPI
Definition api.h:52
BeeCrypt API, headers.
cipherOperation
Specifies whether to perform encryption or decryption.
Definition beecrypt.h:557
const blockCipher blowfish
Holds the full API description of the Blowfish algorithm.
int blowfishSetIV(blowfishParam *, const byte *iv)
This function sets the Initialization Vector.
int blowfishDecrypt(blowfishParam *, uint32_t *, const uint32_t *)
This function performs the Blowfish decryption; it Rderypts one block of 64 bits.
int blowfishSetCTR(blowfishParam *, const byte *nivz, size_t counter)
uint32_t * blowfishFeedback(blowfishParam *)
#define BLOWFISHPSIZE
Definition blowfish.h:41
int blowfishEncrypt(blowfishParam *, uint32_t *, const uint32_t *)
This function performs the Blowfish encryption; it encrypts one block of 64 bits.
int blowfishSetup(blowfishParam *, const byte *, size_t, cipherOperation)
The function performs the cipher's key expansion.
Blowfish block cipher, assembler-optimized routines, headers.
Holds information and pointers to code specific to each cipher.
Definition beecrypt.h:648
Holds all the parameters necessary for the Blowfish cipher.
Definition blowfish.h:51