~ilya-yanok/ubuntu/precise/grub2/fix-for-948716

« back to all changes in this revision

Viewing changes to grub-core/lib/libgcrypt-grub/cipher/camellia.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-01-17 13:43:06 UTC
  • mto: (17.6.26 experimental)
  • mto: This revision was merged to the branch mainline in revision 102.
  • Revision ID: james.westby@ubuntu.com-20110117134306-fy7qewn4s3qdx2pl
Tags: upstream-1.99~rc1
ImportĀ upstreamĀ versionĀ 1.99~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file was automatically imported with 
 
2
   import_gcry.py. Please don't modify it */
 
3
/* camellia.h   ver 1.2.0
 
4
 *
 
5
 * Copyright (C) 2006,2007
 
6
 * NTT (Nippon Telegraph and Telephone Corporation).
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2.1 of the License, or (at your option) any later version.
 
12
 *
 
13
 * This library 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 GNU
 
16
 * Lesser General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Lesser General Public
 
19
 * License along with this library; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 */
 
22
 
 
23
#ifndef HEADER_CAMELLIA_H
 
24
#define HEADER_CAMELLIA_H
 
25
 
 
26
/* To use Camellia with libraries it is often useful to keep the name
 
27
 * space of the library clean.  The following macro is thus useful:
 
28
 *
 
29
 *     #define CAMELLIA_EXT_SYM_PREFIX foo_
 
30
 *  
 
31
 * This prefixes all external symbols with "foo_".
 
32
 */
 
33
#ifdef HAVE_CONFIG_H
 
34
#endif
 
35
#ifdef CAMELLIA_EXT_SYM_PREFIX
 
36
#define CAMELLIA_PREFIX1(x,y) x ## y
 
37
#define CAMELLIA_PREFIX2(x,y) CAMELLIA_PREFIX1(x,y)
 
38
#define CAMELLIA_PREFIX(x)    CAMELLIA_PREFIX2(CAMELLIA_EXT_SYM_PREFIX,x)
 
39
#define Camellia_Ekeygen      CAMELLIA_PREFIX(Camellia_Ekeygen)
 
40
#define Camellia_EncryptBlock CAMELLIA_PREFIX(Camellia_EncryptBlock)
 
41
#define Camellia_DecryptBlock CAMELLIA_PREFIX(Camellia_DecryptBlock)
 
42
#define camellia_decrypt128   CAMELLIA_PREFIX(camellia_decrypt128)
 
43
#define camellia_decrypt256   CAMELLIA_PREFIX(camellia_decrypt256)
 
44
#define camellia_encrypt128   CAMELLIA_PREFIX(camellia_encrypt128)
 
45
#define camellia_encrypt256   CAMELLIA_PREFIX(camellia_encrypt256)
 
46
#define camellia_setup128     CAMELLIA_PREFIX(camellia_setup128)
 
47
#define camellia_setup192     CAMELLIA_PREFIX(camellia_setup192) 
 
48
#define camellia_setup256     CAMELLIA_PREFIX(camellia_setup256)
 
49
#endif /*CAMELLIA_EXT_SYM_PREFIX*/
 
50
 
 
51
 
 
52
#ifdef  __cplusplus
 
53
extern "C" {
 
54
#endif
 
55
 
 
56
#define CAMELLIA_BLOCK_SIZE 16
 
57
#define CAMELLIA_TABLE_BYTE_LEN 272
 
58
#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
 
59
 
 
60
typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
 
61
 
 
62
 
 
63
void Camellia_Ekeygen(const int keyBitLength,
 
64
                      const unsigned char *rawKey, 
 
65
                      KEY_TABLE_TYPE keyTable);
 
66
 
 
67
void Camellia_EncryptBlock(const int keyBitLength,
 
68
                           const unsigned char *plaintext, 
 
69
                           const KEY_TABLE_TYPE keyTable, 
 
70
                           unsigned char *cipherText);
 
71
 
 
72
void Camellia_DecryptBlock(const int keyBitLength, 
 
73
                           const unsigned char *cipherText, 
 
74
                           const KEY_TABLE_TYPE keyTable, 
 
75
                           unsigned char *plaintext);
 
76
 
 
77
 
 
78
#ifdef  __cplusplus
 
79
}
 
80
#endif
 
81
 
 
82
#endif /* HEADER_CAMELLIA_H */