]> git.cryptolib.org Git - avr-crypto-lib.git/blob - skein/threefish_mix_c.c
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / skein / threefish_mix_c.c
1 /* threefish_mix_c.c */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
5
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.
10
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.
15
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/>.
18 */
19 /*
20  * \author  Daniel Otte
21  * \email   bg@nerilex.org
22  * \date    2009-03-16
23  * \license GPLv3 or later
24  * 
25  * 
26  * 
27  */
28
29 #include <stdint.h>
30
31 #define X0 (((uint64_t*)data)[0])
32 #define X1 (((uint64_t*)data)[1])
33 void threefish_mix(void *data, uint8_t rot){
34         uint64_t x;
35         x = X1;
36         X0 += x;
37         X1 = ((x<<rot)|(x>>(64-rot))) ^ X0;
38 }