X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;ds=sidebyside;f=blake_common.c;fp=blake_common.c;h=a7159807128f73d23b213cc4df145f564f582c71;hb=4e31ebdb0529eeb61efd3fe181b9de1abe6d7f6c;hp=0000000000000000000000000000000000000000;hpb=2b8ac5e59c46832e1cced4cc5d1c1610a934766d;p=avr-crypto-lib.git diff --git a/blake_common.c b/blake_common.c new file mode 100644 index 0000000..a715980 --- /dev/null +++ b/blake_common.c @@ -0,0 +1,53 @@ +/* blake_common.c */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2009 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 . +*/ +/* + * \file blake_common.c + * \author Daniel Otte + * \email daniel.otte@rub.de + * \date 2009-05-08 + * \license GPLv3 or later + * + */ + +#include +#include + +uint8_t blake_sigma[] PROGMEM = { + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, + 0xE, 0xA, 0x4, 0x8, 0x9, 0xF, 0xD, 0x6, 0x1, 0xC, 0x0, 0x2, 0xB, 0x7, 0x5, 0x3, + 0xB, 0x8, 0xC, 0x0, 0x5, 0x2, 0xF, 0xD, 0xA, 0xE, 0x3, 0x6, 0x7, 0x1, 0x9, 0x4, + 0x7, 0x9, 0x3, 0x1, 0xD, 0xC, 0xB, 0xE, 0x2, 0x6, 0x5, 0xA, 0x4, 0x0, 0xF, 0x8, + 0x9, 0x0, 0x5, 0x7, 0x2, 0x4, 0xA, 0xF, 0xE, 0x1, 0xB, 0xC, 0x6, 0x8, 0x3, 0xD, + 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