- breq 7f
- rjmp 1b
-
-7:
- /* write block back */
- st X+, V01
- st X+, V02
- st X+, V03
- st X+, V04
- st X+, V11
- st X+, V12
- st X+, V13
- st X+, V14
-
- /* epilog */
- pop r28
- pop r17
- pop r16
- pop r15
- pop r14
- pop r9
- pop r8
- pop r7
- pop r6
- pop r5
- pop r4
- pop r3
- pop r2
- ret
-
- /* #endif */
-
-;####################################################################
-
- #ifdef TWO_IN_ONE
- /* now we use the same base-structure for enc- and decryption
- to indicate operation mode we use the highest bit of param3 (16 bit pointer to key),
- this is ok, since even the larges atmel today has "only" 8k of ram,
- but you shouldn't use this feature while using external ram.
- */
-.global xtea_enc
- ori r21, 0x80
-
-.global xtea_dec
-; == xtea_dec ==
-; xtea decrytion function
-; param1: 16-bit pointer to destination for decrypted block
-; given in r25,r24
-; param2: 16-bit pointer to the block (64-bit) which is to derypt
-; given in r23,r22
-; param3: 16-bit pointer to the key (128-bit)
-; given in r21,r20
-;
-/*
-void xtea_dec(uint32_t* dest, uint32_t* v, uint32_t* k) {
- uint32_t v0=v[0], v1=v[1], i;
- uint32_t sum=0xC6EF3720, delta=0x9E3779B9;
- for(i=0; i<32; i++) {
- v1 -= ((v0 << 4 ^ v0 >> 5) + v0) ^ (sum + k[sum>>11 & 3]);
- sum -= delta;
- v0 -= ((v1 << 4 ^ v1 >> 5) + v1) ^ (sum + k[sum & 3]);
- }
- dest[0]=v0; dest[1]=v1;
-}
-*/