~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to cipher/idea.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

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*/