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 B0 (((uint64_t*)data)[0])
30 #define B1 (((uint64_t*)data)[1])
32 void mix(void* data, uint8_t rot){
36 B1 = ((x<<rot)|(x>>(64-rot))) ^ B0;
62 .global threefish_mix_asm
94 ldi r30, pm_lo8(byte_rot_jmptable)
95 ldi r31, pm_hi8(byte_rot_jmptable)
136 rjmp post_byterot;ret; rjmp byte_rotr_0
144 rjmp post_byterot;ret; rjmp byte_rotr_0
150 byte_rotr_1: /* 10 words */
166 byte_rotr_2: /* 11 words */
182 byte_rotr_3: /* 10 words */
197 byte_rotr_4: /* 13 words */
218 byte_rotr_5: /* 10 words */
233 byte_rotr_6: /* 11 words */
250 byte_rotr_7: /* 10 words */