avr-crypto-lib/serpent/serpent.h

48 lines
1.4 KiB
C
Raw Normal View History

2008-05-26 19:13:21 +00:00
/* serpent.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)
2008-05-26 19:13:21 +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/>.
*/
2008-08-02 10:37:02 +00:00
/** \file serpent.h
* \author Daniel Otte
* \license GPLv3
* \brief a implementation of the serpent cipher for avr microcontrollers
2008-04-02 13:35:03 +00:00
*/
#ifndef SERPENT_H_
#define SERPENT_H_
#include <stdint.h>
typedef uint32_t serpent_subkey_t[4];
2008-04-02 13:35:03 +00:00
typedef struct serpent_ctx_st {
serpent_subkey_t k[33];
} serpent_ctx_t;
2008-04-03 01:02:01 +00:00
#define SERPENT_KEY128 128
#define SERPENT_KEY192 192
2008-08-02 10:37:02 +00:00
#define SERPENT_KEY256 256
2008-04-03 01:02:01 +00:00
2008-04-02 13:35:03 +00:00
/* key must be 256bit (32 byte) large! */
void serpent_init(const void *key, uint16_t keysize_b, serpent_ctx_t *ctx);
void serpent_enc(void *buffer, const serpent_ctx_t *ctx);
void serpent_dec(void *buffer, const serpent_ctx_t *ctx);
2008-04-02 13:35:03 +00:00
#endif /*SERPENT_H_*/