X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=camellia.c;h=a6a88d2419c6f499052e0291b6ba7262ca9ea21a;hb=37d550b5d03ebe6cc51c6e7bbc897f9520ea7422;hp=cfcd561e2811c2a385f5dc928f6125061225fb03;hpb=bfac0f0eef1c956bf6fbc023708f17ecfda9b39d;p=avr-crypto-lib.git diff --git a/camellia.c b/camellia.c index cfcd561..a6a88d2 100644 --- a/camellia.c +++ b/camellia.c @@ -1,3 +1,21 @@ +/* camellia.c */ +/* + This file is part of the Crypto-avr-lib/microcrypt-lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ /** * * @@ -64,7 +82,7 @@ void camellia128_ctx_dump(camellia128_ctx_t *s){ /*****************************************************************************/ /* extern prog_uint64_t camellia_sigma[6]; */ -void camellia128_init(camellia128_ctx_t* s, uint8_t* key){ +void camellia128_init(uint8_t* key, camellia128_ctx_t* s){ uint8_t i; s->kll = 0; /* ((uint64_t*)key)[0]; */ @@ -116,14 +134,14 @@ void camellia_6rounds(camellia128_ctx_t* s, uint64_t* bl, uint64_t* br, uint8_t /*****************************************************************************/ -void camellia128_enc(camellia128_ctx_t* s, void* block){ +void camellia128_enc(void* block, camellia128_ctx_t* s){ #define BL (((uint64_t*)block)[0]) #define BR (((uint64_t*)block)[1]) /* endian adjustment */ /*BL*/ /* 1 2 3 4 5 6 7 8 - * 8 7 6 5 4 3 2 1 + * 8 7 6 5 4 3 2 1 */ uint64_t temp64; @@ -170,7 +188,7 @@ void camellia128_enc(camellia128_ctx_t* s, void* block){ /*****************************************************************************/ -void camellia128_dec(camellia128_ctx_t* s, void* block){ +void camellia128_dec(void* block, camellia128_ctx_t* s){ #define BL (((uint64_t*)block)[1]) #define BR (((uint64_t*)block)[0])