1 | /* |
---|
2 | |
---|
3 | idea.h |
---|
4 | |
---|
5 | Author: Tatu Ylonen <ylo@cs.hut.fi> |
---|
6 | |
---|
7 | Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
---|
8 | All rights reserved |
---|
9 | |
---|
10 | Created: Sun Jun 25 04:44:30 1995 ylo |
---|
11 | |
---|
12 | The IDEA encryption algorithm. |
---|
13 | |
---|
14 | */ |
---|
15 | |
---|
16 | /* |
---|
17 | * $Id: idea.h,v 1.1.1.2 1999-03-08 17:43:35 danw Exp $ |
---|
18 | * $Log: not supported by cvs2svn $ |
---|
19 | * Revision 1.1.1.1 1996/02/18 21:38:11 ylo |
---|
20 | * Imported ssh-1.2.13. |
---|
21 | * |
---|
22 | * Revision 1.2 1995/07/13 01:25:00 ylo |
---|
23 | * Removed "Last modified" header. |
---|
24 | * Added cvs log. |
---|
25 | * |
---|
26 | * $Endlog$ |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef IDEA_H |
---|
30 | #define IDEA_H |
---|
31 | |
---|
32 | typedef struct |
---|
33 | { |
---|
34 | word16 key_schedule[52]; |
---|
35 | } IDEAContext; |
---|
36 | |
---|
37 | /* Sets idea key for encryption. */ |
---|
38 | void idea_set_key(IDEAContext *c, const unsigned char key[16]); |
---|
39 | |
---|
40 | /* Destroys any sensitive data in the context. */ |
---|
41 | void idea_destroy_context(IDEAContext *c); |
---|
42 | |
---|
43 | /* Performs the IDEA cipher transform on a block of data. */ |
---|
44 | void idea_transform(IDEAContext *c, word32 l, word32 r, word32 *output); |
---|
45 | |
---|
46 | /* Encrypts len bytes from src to dest in CFB mode. Len need not be a multiple |
---|
47 | of 8; if it is not, iv at return will contain garbage. |
---|
48 | Otherwise, iv will be modified at end to a value suitable for continuing |
---|
49 | encryption. */ |
---|
50 | void idea_cfb_encrypt(IDEAContext *c, unsigned char *iv, unsigned char *dest, |
---|
51 | const unsigned char *src, unsigned int len); |
---|
52 | |
---|
53 | |
---|
54 | /* Decrypts len bytes from src to dest in CFB mode. Len need not be a multiple |
---|
55 | of 8; if it is not, iv at return will contain garbage. |
---|
56 | Otherwise, iv will be modified at end to a value suitable for continuing |
---|
57 | decryption. */ |
---|
58 | void idea_cfb_decrypt(IDEAContext *c, unsigned char *iv, unsigned char *dest, |
---|
59 | const unsigned char *src, unsigned int len); |
---|
60 | |
---|
61 | #endif /* IDEA_H */ |
---|
62 | |
---|