1 /* noekeon_cbc_enc.S */
3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
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 bg@nerilex.org
23 * \license GPLv3 or later
29 .macro push_ p1:req p2:vararg
36 .macro pop_ p1:req p2:vararg
46 * void noekeon_cbc_enc(void *buffer, uint8_t block_cnt, const void *key)
49 /* param buffer is passed in r24:r25
50 * param block_cnt is passed in r22 (r23 is 0)
51 * param key is passed in r20:r21
53 .global noekeon_cbc_enc
57 push_ r22, r23, r24, r25
60 pop_ r27, r26, r23, r22
61 pop r16 /* block counter */
77 /* call encryption function; X points to our new block */
78 push_ r22, r23, r26, r27