~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to cipher/idea.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* idea.h
 
2
 *      Copyright (c) 1997 by Werner Koch (dd9jn)
 
3
 *
 
4
 * ATTENTION: This code patented and needs a license for any commercial use.
 
5
 *
 
6
 * This file is part of G10.
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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
 
21
 */
 
22
#ifndef G10_IDEA_H
 
23
#define G10_IDEA_H
 
24
 
 
25
#include "types.h"
 
26
 
 
27
#define IDEA_KEYSIZE 16
 
28
#define IDEA_BLOCKSIZE 8
 
29
#define IDEA_ROUNDS 8
 
30
#define IDEA_KEYLEN (6*IDEA_ROUNDS+4)
 
31
 
 
32
typedef struct {
 
33
    u16 ek[IDEA_KEYLEN];
 
34
    u16 dk[IDEA_KEYLEN];
 
35
    byte iv[IDEA_BLOCKSIZE];
 
36
    byte lastcipher[IDEA_BLOCKSIZE];
 
37
    int  nleft;
 
38
} IDEA_context;
 
39
 
 
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 );
 
49
 
 
50
 
 
51
#endif /*G10_IDEA_H*/