2N/A * Copyright (C) 2007 Free Software Foundation, Inc. 2N/A * This file is part of Libgcrypt. 2N/A * Libgcrypt is free software; you can redistribute it and/or modify 2N/A * it under the terms of the GNU Lesser General Public License as 2N/A * published by the Free Software Foundation; either version 2.1 of 2N/A * the License, or (at your option) any later version. 2N/A * Libgcrypt is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU Lesser General Public 2N/A * License along with this program; if not, write to the Free Software 2N/A * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2N/A/* I put all the libgcrypt-specific stuff in this file to keep the 2N/A update their code, this should make it easier to bring the changes 2N/A There is one small change which needs to be done: Include the 2N/A/* To use Camellia with libraries it is often useful to keep the name 2N/A * space of the library clean. The following macro is thus useful: 2N/A * #define CAMELLIA_EXT_SYM_PREFIX foo_ 2N/A * This prefixes all external symbols with "foo_". 2N/A#
endif /*CAMELLIA_EXT_SYM_PREFIX*/ 2N/A#
endif /* Code sample. */ 2N/A ((
19+
34+
34)*
sizeof(
u32)+
2*
sizeof(
void*)
/* camellia_setup256 */ 2N/A +(
4+
32)*
sizeof(
u32)+
2*
sizeof(
void*)
/* camellia_setup192 */ 2N/A +0+
sizeof(
int)+
2*
sizeof(
void*)
/* Camellia_Ekeygen */ 2N/A +
3*
2*
sizeof(
void*)
/* Function calls. */ 2N/A +
2*
2*
sizeof(
void*)
/* Function calls. */ 2N/A +
2*
2*
sizeof(
void*)
/* Function calls. */ 2N/A /* These test vectors are from RFC-3713 */ 2N/A 0x01,
0x23,
0x45,
0x67,
0x89,
0xab,
0xcd,
0xef,
2N/A 0xfe,
0xdc,
0xba,
0x98,
0x76,
0x54,
0x32,
0x10 2N/A 0x01,
0x23,
0x45,
0x67,
0x89,
0xab,
0xcd,
0xef,
2N/A 0xfe,
0xdc,
0xba,
0x98,
0x76,
0x54,
0x32,
0x10 2N/A 0x67,
0x67,
0x31,
0x38,
0x54,
0x96,
0x69,
0x73,
2N/A 0x08,
0x57,
0x06,
0x56,
0x48,
0xea,
0xbe,
0x43 2N/A 0x01,
0x23,
0x45,
0x67,
0x89,
0xab,
0xcd,
0xef,
0xfe,
0xdc,
0xba,
0x98,
2N/A 0x76,
0x54,
0x32,
0x10,
0x00,
0x11,
0x22,
0x33,
0x44,
0x55,
0x66,
0x77 2N/A 0xb4,
0x99,
0x34,
0x01,
0xb3,
0xe9,
0x96,
0xf8,
2N/A 0x4e,
0xe5,
0xce,
0xe7,
0xd7,
0x9b,
0x09,
0xb9 2N/A 0x01,
0x23,
0x45,
0x67,
0x89,
0xab,
0xcd,
0xef,
0xfe,
0xdc,
0xba,
2N/A 0x98,
0x76,
0x54,
0x32,
0x10,
0x00,
0x11,
0x22,
0x33,
0x44,
0x55,
2N/A 0x66,
0x77,
0x88,
0x99,
0xaa,
0xbb,
0xcc,
0xdd,
0xee,
0xff 2N/A 0x9a,
0xcc,
0x23,
0x7d,
0xff,
0x16,
0xd7,
0x6c,
2N/A 0x20,
0xef,
0x7c,
0x91,
0x9e,
0x3a,
0x75,
0x09 2N/A return "CAMELLIA-128 test encryption failed.";
2N/A return "CAMELLIA-128 test decryption failed.";
2N/A return "CAMELLIA-192 test encryption failed.";
2N/A return "CAMELLIA-192 test decryption failed.";
2N/A return "CAMELLIA-256 test encryption failed.";
2N/A return "CAMELLIA-256 test decryption failed.";
2N/A/* These oids are from 2N/A retrieved May 1, 2007. */