1 /* threefish_invmix.S */
3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2009 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/>.
21 * \email daniel.otte@rub.de
23 * \license GPLv3 or later
26 #include "avr-asm-macros.S"
29 #define X0 (((uint64_t*)data)[0])
30 #define X1 (((uint64_t*)data)[1])
31 void threefish_invmix(void* data, uint8_t rot){
35 X1 = ((x>>rot)|(x<<(64-rot)));
62 .global threefish_invmix_asm
94 ldi r30, pm_lo8(byte_rot_jmptable)
95 ldi r31, pm_hi8(byte_rot_jmptable)
135 rjmp post_byterot;ret; rjmp byte_rotr_0
143 rjmp post_byterot;ret; rjmp byte_rotr_0
151 byte_rotr_1: /* 10 words */
167 byte_rotr_2: /* 11 words */
183 byte_rotr_3: /* 10 words */
198 byte_rotr_4: /* 13 words */
219 byte_rotr_5: /* 10 words */
234 byte_rotr_6: /* 11 words */
251 byte_rotr_7: /* 10 words */