/* twister-big.c */
+/*
+ This file is part of the AVR-Crypto-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 <http://www.gnu.org/licenses/>.
+*/
#include <stdint.h>
#include <string.h>
/*********************************************************************/
-void twister_big_nextBlock(twister_big_ctx_t* ctx, void* msg){
+void twister_big_nextBlock(twister_big_ctx_t* ctx, const void* msg){
uint8_t tmp[8][8];
/* 1st maxi round */
/*********************************************************************/
-void twister_big_lastBlock(twister_big_ctx_t* ctx, void* msg, uint16_t length_b){
+void twister_big_lastBlock(twister_big_ctx_t* ctx, const void* msg, uint16_t length_b){
uint8_t tmp[64];
while(length_b>512){
twister_big_nextBlock(ctx, msg);
/*********************************************************************/
-void twister384_nextBlock(twister384_ctx_t* ctx, void* msg){
+void twister384_nextBlock(twister384_ctx_t* ctx, const void* msg){
twister_big_nextBlock(ctx, msg);
}
/*********************************************************************/
-void twister384_lastBlock(twister384_ctx_t* ctx, void* msg, uint16_t length_b){
+void twister384_lastBlock(twister384_ctx_t* ctx, const void* msg, uint16_t length_b){
twister_big_lastBlock(ctx, msg, length_b);
}
/*********************************************************************/
-void twister384(void* dest, void* msg, uint32_t msg_length_b){
+void twister384(void* dest, const void* msg, uint32_t msg_length_b){
twister_big_ctx_t ctx;
twister_big_init(&ctx, 384);
while(msg_length_b >=512){
/*********************************************************************/
-void twister512_nextBlock(twister512_ctx_t* ctx, void* msg){
+void twister512_nextBlock(twister512_ctx_t* ctx, const void* msg){
twister_big_nextBlock(ctx, msg);
}
/*********************************************************************/
-void twister512_lastBlock(twister512_ctx_t* ctx, void* msg, uint16_t length_b){
+void twister512_lastBlock(twister512_ctx_t* ctx, const void* msg, uint16_t length_b){
twister_big_lastBlock(ctx, msg, length_b);
}
/*********************************************************************/
-void twister512(void* dest, void* msg, uint32_t msg_length_b){
+void twister512(void* dest, const void* msg, uint32_t msg_length_b){
twister_big_ctx_t ctx;
twister_big_init(&ctx, 512);
while(msg_length_b >=512){