Posted: Fri Apr 03, 2015 5:44 pm Post subject: XTEA, Bootloader and AVRDOS
Hello,
i have a "little" Problem:
I try to buld a bootloader for a AT90CAN128 attached with a SD-Card. Without key i can now flash my new file and work.
I would make a encrypted .bin-File with the $XTEAKEY. How i have to decode the .bin-File by my bootloader?
Code:
Writepage: Print #1 , "."; For J =1To128Step2' we write 2 bytes into a page
Vl = Buf(j): Vh = Buf(j +1)' get Low and High bytes
If Crypt =1Then
Vl = Decrypt_table(vl): Vh = Decrypt_table(vh)' <--------------------------------- here in "Vl" and "Vh" i have to put the decryptet Byte. How i have to decrypt it first? The "Decrypt_table" was a test but dont work! End If
Spmcrval =1:Gosub Do_spm ' write value into page at word address
Wrd = Wrd +2' word address increases with 2 because LS bit of Z is not used If Wrd = Maxword Then
Wrd =0' Z pointer needs wrd to be 0
Spmcrval =5:Gosub Do_spm ' write page
Spmcrval =17:Gosub Do_spm ' re-enable page
Page = Page +1' next page
If Page <= Maxpages Then' avoid to erase first page of bootlaoder
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum