3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * \brief declarations for seed
32 /** \typedef seed_ctx_t
35 * A variable of this type may hold the key material for the SEED cipher.
36 * This context is regulary generated by the
37 * void seed_init(const void * key, seed_ctx_t * ctx) function.
43 /******************************************************************************/
45 /** \fn void seed_init(const void * key, seed_ctx_t * ctx)
46 * \brief initializes context for SEED operation
48 * This function copys the key material into a context variable.
50 * \param key pointer to the key material (128 bit = 16 bytes)
51 * \param ctx pointer to the context (seed_ctx_t)
53 void seed_init(const void * key, seed_ctx_t * ctx);
55 /** \fn void seed_enc(void * buffer,const seed_ctx_t * ctx)
56 * \brief encrypt a block with SEED
58 * This function encrypts a block of 64 bits (8 bytes) with the SEED algorithm.
59 * The round keys are computed on demand, so the context is modifyed while
60 * encrypting but the original stated is restored when the function exits.
62 * \param buffer pointer to the block (64 bit = 8 byte) which will be encrypted
63 * \param ctx pointer to the key material (seed_ctx_t)
65 void seed_enc(void * buffer, const seed_ctx_t * ctx);
68 /** \fn void seed_dec(void * buffer, const seed_ctx_t * ctx)
69 * \brief decrypt a block with SEED
71 * This function decrypts a block of 64 bits (8 bytes) with the SEED algorithm.
72 * The round keys are computed on demand, so the context is modifyed while
73 * decrypting but the original stated is restored when the function exits.
75 * \param buffer pointer to the block (64 bit = 8 byte) which will be decrypted
76 * \param ctx pointer to the key material (seed_ctx_t)
78 void seed_dec(void * buffer, const seed_ctx_t * ctx);