X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=serpent-sboxes-small.S;h=76aafdb48d66dc00349ffc451692ce663583e338;hb=17332291e15183d71d88ed868275e3cb53917180;hp=3259240338a1f9efbc96d84dd017571b26220443;hpb=0f66a12e93ed43904c30810ac33c79c87befafe7;p=avr-crypto-lib.git diff --git a/serpent-sboxes-small.S b/serpent-sboxes-small.S index 3259240..76aafdb 100644 --- a/serpent-sboxes-small.S +++ b/serpent-sboxes-small.S @@ -1,6 +1,6 @@ /* serpent_sboxes.S */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. + This file is part of the This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -27,64 +27,9 @@ */ #include +#include "avr-asm-macros.S" -/******************************************************************************* -* MACRO SECTION * -*******************************************************************************/ -.macro push_ p1:req, p2:vararg - push \p1 -.ifnb \p2 - push_ \p2 -.endif -.endm - -.macro pop_ p1:req, p2:vararg - pop \p1 -.ifnb \p2 - pop_ \p2 -.endif -.endm - -.macro push_range from:req, to:req - push \from -.if \to-\from - push_range "(\from+1)",\to -.endif -.endm - -.macro pop_range from:req, to:req - pop \to -.if \to-\from - pop_range \from,"(\to-1)" -.endif -.endm - -.macro stack_alloc size:req, reg1=r30, reg2=r31 - in r0, _SFR_IO_ADDR(SREG) - cli - in \reg1, _SFR_IO_ADDR(SPL) - in \reg2, _SFR_IO_ADDR(SPH) - sbiw \reg1, \size - out _SFR_IO_ADDR(SPH), \reg2 - out _SFR_IO_ADDR(SPL), \reg1 - out _SFR_IO_ADDR(SREG), r0 -.endm - -.macro stack_free size:req, reg1=r30, reg2=r31 - in r0, _SFR_IO_ADDR(SREG) - cli - in \reg1, _SFR_IO_ADDR(SPL) - in \reg2, _SFR_IO_ADDR(SPH) - adiw \reg1, \size - out _SFR_IO_ADDR(SPH), \reg2 - out _SFR_IO_ADDR(SPL), \reg1 - out _SFR_IO_ADDR(SREG), r0 -.endm - -/******************************************************************************* -* END of MACRO SECTION * -*******************************************************************************/ serpent_sbox: .byte 0x83, 0x1F, 0x6A, 0xB5, 0xDE, 0x24, 0x07, 0xC9 .byte 0xCF, 0x72, 0x09, 0xA5, 0xB1, 0x8E, 0xD6, 0x43