This commit is contained in:
bg 2012-02-28 15:25:59 +00:00
parent b246a2a058
commit 2bd3b1adfa
2 changed files with 26 additions and 16 deletions

View File

@ -87,7 +87,7 @@ void entropium_addEntropy(unsigned length_b, const void* data){
void entropium_getRandomBlock(void *b){ void entropium_getRandomBlock(void *b){
sha256_ctx_t s; sha256_ctx_t s;
uint8_t offset=8; static uint8_t offset=8;
sha256_init(&s); sha256_init(&s);
sha256_lastBlock(&s, rndCore, 512); /* remeber the byte order! */ sha256_lastBlock(&s, rndCore, 512); /* remeber the byte order! */

View File

@ -1,6 +1,6 @@
/* xtea-enc.S */ /* xtea-asm.S */
/* /*
This file is part of the ARM-Crypto-Lib. This file is part of the AVR-Crypto-Lib.
Copyright (C) 2006-2011 Daniel Otte (daniel.otte@rub.de) Copyright (C) 2006-2011 Daniel Otte (daniel.otte@rub.de)
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -29,15 +29,15 @@ A1 = 9
A2 = 10 A2 = 10
A3 = 11 A3 = 11
V10 = 12 V00 = 12
V11 = 13 V01 = 13
V12 = 14 V02 = 14
V13 = 15 V03 = 15
V00 = 16 V10 = 16
V01 = 17 V11 = 17
V02 = 18 V12 = 18
V03 = 19 V13 = 19
S0 = 20 S0 = 20
S1 = 21 S1 = 21
@ -124,6 +124,7 @@ main1:
mov r24, S0 mov r24, S0
lsl r24 lsl r24
lsl r24 lsl r24
20:
rcall sum_plus_k rcall sum_plus_k
ret ret
@ -132,9 +133,8 @@ main2:
rcall g_func rcall g_func
mov r24, S1 mov r24, S1
lsr r24 lsr r24
rcall sum_plus_k
rcall xchg_V0V1 rcall xchg_V0V1
ret rjmp 20b
.global xtea_enc .global xtea_enc
xtea_enc: xtea_enc:
@ -184,6 +184,7 @@ xtea_intro:
xtea_enc_exit: xtea_enc_exit:
pop r27 pop r27
pop r26 pop r26
/*
st X+, V00 st X+, V00
st X+, V01 st X+, V01
st X+, V02 st X+, V02
@ -192,13 +193,22 @@ xtea_enc_exit:
st X+, V11 st X+, V11
st X+, V12 st X+, V12
st X+, V13 st X+, V13
*/
clr r31
ldi r30, V00
ldi r24, 8
10:
ld r0, Z+
st X+, r0
dec r24
brne 10b
clr r27 ; clr r31
ldi r26, 18 ldi r30, 18
ldi r24, 14 ldi r24, 14
10: 10:
pop r0 pop r0
st -X, r0 st -Z, r0
dec r24 dec r24
brne 10b brne 10b
ret ret