2
* Copyright (c) 1997 by Werner Koch (dd9jn)
4
* ATTENTION: This code patented and needs a license for any commercial use.
6
* This file is part of G10.
8
* G10 is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* G10 is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
27
#define IDEA_KEYSIZE 16
28
#define IDEA_BLOCKSIZE 8
30
#define IDEA_KEYLEN (6*IDEA_ROUNDS+4)
35
byte iv[IDEA_BLOCKSIZE];
36
byte lastcipher[IDEA_BLOCKSIZE];
40
void idea_setkey( IDEA_context *c, byte *key );
41
void idea_setiv( IDEA_context *c, byte *iv );
42
void idea_encode( IDEA_context *c, byte *out, byte *in, unsigned nblocks );
43
void idea_decode( IDEA_context *c, byte *out, byte *in, unsigned nblocks );
44
void idea_encode_cfb( IDEA_context *c, byte *outbuf,
45
byte *inbuf, unsigned nbytes);
46
void idea_decode_cfb( IDEA_context *c, byte *outbuf,
47
byte *inbuf, unsigned nbytes);
48
void idea_sync_cfb( IDEA_context *c );