2009-06-09 23:57:20 +00:00
|
|
|
/* groestl_small.h */
|
|
|
|
/*
|
|
|
|
This file is part of the AVR-Crypto-Lib.
|
2015-02-06 02:43:31 +00:00
|
|
|
Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
|
2009-06-09 23:57:20 +00:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* \file groestl_small.h
|
|
|
|
* \author Daniel Otte
|
2015-02-06 02:43:31 +00:00
|
|
|
* \email bg@nerilex.org
|
2009-06-09 23:57:20 +00:00
|
|
|
* \date 2009-05-19
|
|
|
|
* \license GPLv3 or later
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef GROESTL_SMALL_H_
|
|
|
|
#define GROESTL_SMALL_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#define GROESTL_SMALL_BLOCKSIZE 512
|
|
|
|
#define GROESTL_SMALL_BLOCKSIZE_B ((GROESTL_SMALL_BLOCKSIZE+7)/8)
|
|
|
|
#define GROESTL224_BLOCKSIZE GROESTL_SMALL_BLOCKSIZE
|
2009-06-14 07:10:43 +00:00
|
|
|
#define GROESTL224_BLOCKSIZE_B GROESTL_SMALL_BLOCKSIZE_B
|
2009-06-09 23:57:20 +00:00
|
|
|
#define GROESTL256_BLOCKSIZE GROESTL_SMALL_BLOCKSIZE
|
|
|
|
#define GROESTL256_BLOCKSIZE_B GROESTL_SMALL_BLOCKSIZE_B
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t h[8*8];
|
|
|
|
uint32_t counter;
|
|
|
|
} groestl_small_ctx_t;
|
|
|
|
|
|
|
|
typedef groestl_small_ctx_t groestl224_ctx_t;
|
|
|
|
typedef groestl_small_ctx_t groestl256_ctx_t;
|
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl224_init(groestl224_ctx_t *ctx);
|
|
|
|
void groestl256_init(groestl256_ctx_t *ctx);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl_small_nextBlock(groestl_small_ctx_t *ctx, const void *block);
|
|
|
|
void groestl_small_lastBlock(groestl_small_ctx_t *ctx, const void *block, uint16_t length_b);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl224_nextBlock(groestl224_ctx_t *ctx, const void *block);
|
|
|
|
void groestl224_lastBlock(groestl224_ctx_t *ctx, const void *block, uint16_t length_b);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl256_nextBlock(groestl256_ctx_t *ctx, const void *block);
|
|
|
|
void groestl256_lastBlock(groestl256_ctx_t *ctx, const void *block, uint16_t length_b);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl224_ctx2hash(void *dest, const groestl224_ctx_t *ctx);
|
|
|
|
void groestl256_ctx2hash(void *dest, const groestl256_ctx_t *ctx);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
2013-02-17 09:44:36 +00:00
|
|
|
void groestl224(void *dest, const void *msg, uint32_t length_b);
|
|
|
|
void groestl256(void *dest, const void *msg, uint32_t length_b);
|
2009-06-09 23:57:20 +00:00
|
|
|
|
|
|
|
#endif /* GROESTL_GROESTL_H_ */
|