├── src ├── jumpy │ ├── solution.txt │ └── jumpy.c ├── README.md ├── aesprotected │ ├── gf256mul.h │ ├── aesProtected.h │ ├── gf256mul.S │ └── aesProtected.c ├── Makefile ├── hardsca │ └── hardsca.c ├── mediumsca │ └── mediumsca.c ├── simplesca │ └── simplesca.c ├── whac_the_mole │ └── whack_the_mole.c ├── secretsauce │ └── secretsauce.c └── jungle │ └── jungle.c ├── challenges └── binaries │ ├── scalate │ └── scalate.txt │ ├── jumpy │ ├── jumpy.bin │ ├── jumpy_readme.txt │ └── jumpy.hex │ ├── still_not_scary │ ├── still_not_scary.txt │ └── still_not_scary.hex │ ├── animals │ ├── animals_readme.txt │ └── animals.hex │ ├── piece_of_scake │ ├── piece_of_scake.txt │ └── piece_of_scake.hex │ ├── whac_the_mole │ └── whac_the_mole_readme.txt │ ├── emergency_transmitter │ ├── emergency_transmitter_readme.txt │ └── emergency_transmitter.hex │ ├── key_server │ ├── key_server_readme.txt │ └── key_server.hex │ ├── casino │ └── casino_readme.txt │ ├── secret_sauce │ └── secret_sauce_readme.txt │ ├── photo_manager │ ├── photo_manager_readme.txt │ └── photo_manager.hex │ ├── fiesta │ ├── fiesta_readme.txt │ └── fiesta.hex │ ├── avr_filesystem │ └── avr_filesystem_readme.txt │ ├── fine_tuning │ ├── fine_tuning_readme.txt │ └── fine_tuning.hex │ └── fiasco │ ├── fiasco_readme.txt │ └── fiasco.hex ├── RHme2_prequalification_challenge └── README.md /src/jumpy/solution.txt: -------------------------------------------------------------------------------- 1 | g1v3_1t_t0_m3 -------------------------------------------------------------------------------- /challenges/binaries/scalate/scalate.txt: -------------------------------------------------------------------------------- 1 | We added even more countermeasures. 2 | 3 | Good luck! 4 | -------------------------------------------------------------------------------- /RHme2_prequalification_challenge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Keysight/Rhme-2016/HEAD/RHme2_prequalification_challenge -------------------------------------------------------------------------------- /challenges/binaries/jumpy/jumpy.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Keysight/Rhme-2016/HEAD/challenges/binaries/jumpy/jumpy.bin -------------------------------------------------------------------------------- /challenges/binaries/still_not_scary/still_not_scary.txt: -------------------------------------------------------------------------------- 1 | We added a simple countermeasure to the previous challenge. 2 | 3 | Will you be able to break it? 4 | -------------------------------------------------------------------------------- /challenges/binaries/animals/animals_readme.txt: -------------------------------------------------------------------------------- 1 | After decades of research, we have finally managed to catalogue all 2 | the animals on the planet earth. Including very rare pictures! 3 | -------------------------------------------------------------------------------- /challenges/binaries/jumpy/jumpy_readme.txt: -------------------------------------------------------------------------------- 1 | We really need access to this lab protected with an Arduino-based 2 | access control system. Our operatives obtained a flash dump from a 3 | non-personalized engineering sample, but we are having trouble reverse 4 | engineering it. 5 | 6 | Can you help us get the password to get through? 7 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # Rhme-2016 2 | 3 | The source code is not compilable at the moment, it will be possible to 4 | compile it eventually once all the dependencies are in place. It is 5 | posted here to help you understand the vulnerabilities. 6 | 7 | ## Compilation 8 | 9 | ### Tools 10 | 11 | ### Instructions 12 | 13 | 14 | -------------------------------------------------------------------------------- /challenges/binaries/piece_of_scake/piece_of_scake.txt: -------------------------------------------------------------------------------- 1 | This is an easy SCA challenge using a cipher implementation without 2 | any SCA or DFA countermeasures. Find the key used to encrypt and 3 | decrypt messages. Please, consider both SCA and DFA attacks. 4 | 5 | To encrypt a message, send the letter 'e' followed of 16 bytes. To 6 | decrypt a message, send the letter 'd' followed of 16 bytes. 7 | -------------------------------------------------------------------------------- /challenges/binaries/whac_the_mole/whac_the_mole_readme.txt: -------------------------------------------------------------------------------- 1 | Who doesn't like a classic game of whac-the-mole? This time the moles 2 | infiltrated deep into the backyard of a poor farmer's family. The 3 | moles are ruining the crops, which the farmer desperately needs to 4 | provide for his wife and 2 children. Any traveler able to help him by 5 | extinguishing the darn things will be greatly rewarded. Are you up for 6 | the task? 7 | -------------------------------------------------------------------------------- /challenges/binaries/emergency_transmitter/emergency_transmitter_readme.txt: -------------------------------------------------------------------------------- 1 | We captured a crazy guy aiming a LED at planes passing by. We believe 2 | he is a spy from the Republic of Wadiya. Your task is to reverse how 3 | the device works and extract the keys without analyzing power or 4 | electromagnetic traces. 5 | 6 | Good luck random internet player! 7 | 8 | Note: This challenge can be solved without fancy hardware. You can 9 | check if you got the right flag (key) by encrypting the input and 10 | comparing it against the output. 11 | -------------------------------------------------------------------------------- /challenges/binaries/key_server/key_server_readme.txt: -------------------------------------------------------------------------------- 1 | We have received a portable asymmetric key storage for evaluation 2 | purposes. This portable device was manufactured by Ebian Corp to 3 | facilitate secure communications with customers. It generates and 4 | stores adminstrators' public keys. Customers can use this repository 5 | to find the public key of the admin they want to contact, and 6 | administrators can use this repository to update their key 7 | information. If this fancy keychain passes the test we are going to 8 | give them away like candy, secure candy. 9 | -------------------------------------------------------------------------------- /challenges/binaries/casino/casino_readme.txt: -------------------------------------------------------------------------------- 1 | Welcome to our casino, Riscure Royale! Please enjoy your stay by 2 | playing a game, or drink something at our bar. Reach 1000 credits and 3 | you will be rewarded with a special prize. 4 | 5 | We have seen loads of cheaters lately, so we have extra guards walking 6 | around. Do not feel threatened by them, they will only kick out the 7 | people that cheat. Of course, once you earn a lot of money they will 8 | start investigating the matter. Better spend some money at our bar if 9 | this happens. 10 | 11 | PS. We all know casinos are scams. 12 | -------------------------------------------------------------------------------- /challenges/binaries/secret_sauce/secret_sauce_readme.txt: -------------------------------------------------------------------------------- 1 | We managed to capture a group of spies at our premises. Our 2 | specialists in enhanced interrogation techniques worked through the 3 | entire night but did not manage to retrieve any information. 4 | 5 | Luckily, we intercepted the spy as they were trying to chew and 6 | swallow the Arduino Nano device that they were carrying in their 7 | pocket. The device is protected with a password and the Pure Software 8 | Exploitation Team applied all the tricks they have but did not find 9 | any way to guess the secret password. 10 | 11 | Can you find the correct password and get the secret data stored on 12 | the device? 13 | -------------------------------------------------------------------------------- /challenges/binaries/photo_manager/photo_manager_readme.txt: -------------------------------------------------------------------------------- 1 | We have recently been informed that a group of hackers exploited a 2 | vulnerability in a PC within another very secure network. Our 3 | operative says the hacker in charge took a snapshot of the password, 4 | which they stored in their secret hidden-away database. 5 | 6 | Today we found a photo manager service running on the internet. This 7 | service can be linked to the hacker who retrieved the passwords. From 8 | the size of the photo manager we can see they stored lots of pictures, 9 | so we are hoping they stored the password on their photo manager 10 | too. Can you breach their photo manager and take a quick look? 11 | -------------------------------------------------------------------------------- /challenges/binaries/fiesta/fiesta_readme.txt: -------------------------------------------------------------------------------- 1 | Elias Öberson @DrAndroid1337 - Nov 1 2 | 3 | Walking around the financial district, I stumbled upon this strange 4 | device. Does anybody know what it is? 5 | 6 | Elias Öberson @DrAndroid1337 - Nov 1 7 | 8 | It does not have any recognisable logos or marks, only the letters 9 | "V1" written on one side and a USB connector on the other. Here is a 10 | photo. 11 | 12 | Elias Öberson @DrAndroid1337 - Nov 1 13 | 14 | It probably is some kind of memory, but it has an unusual design. I 15 | will check it when I arrive home. 16 | 17 | Elias Öberson @DrAndroid1337 - Nov 1 18 | 19 | I finally arrived home. I connected the USB device to my computer, but 20 | it looks that it is permanently locked. 21 | 22 | Elias Öberson @DrAndroid1337 - Nov 1 23 | 24 | Now I am curious about the device and its content. Would I be able to 25 | unlock it using FI? 26 | -------------------------------------------------------------------------------- /src/aesprotected/gf256mul.h: -------------------------------------------------------------------------------- 1 | /* gf256mul.h */ 2 | /* 3 | This file is part of the AVR-Crypto-Lib. 4 | Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) 5 | 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. 10 | 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. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | */ 19 | #ifndef GF256MUL_H_ 20 | #define GF256MUL_H_ 21 | 22 | /** 23 | * \author Daniel Otte 24 | * \email bg@nerilex.org 25 | * \date 2008-12-19 26 | * \license GPLv3 27 | * \brief 28 | * 29 | * 30 | */ 31 | 32 | #include 33 | 34 | uint8_t gf256mul(uint8_t a, uint8_t b, uint8_t reducer); 35 | 36 | #endif /* GF256MUL_H_ */ 37 | -------------------------------------------------------------------------------- /challenges/binaries/avr_filesystem/avr_filesystem_readme.txt: -------------------------------------------------------------------------------- 1 | We don't remember why, but we wanted a file system on an 2 | AVR328p. After the system was completed we discovered that it lacked 3 | basic security. A couple of beers later we came up with what we think 4 | is a revolutionary way to do file system permissions. It is now your 5 | task to fill in our shoes and test its security. 6 | 7 | The filesystem allows you to request the contents of one or more 8 | available files by using the following format: 9 | 10 | token#[:] 11 | 12 | So for example, a request would be: 13 | 14 | 933d86ae930c9a5d6d3a334297d9e72852f05c57#cat.txt:finances.csv 15 | 16 | Some example files (token | call): 17 | 18 | 96103df3b928d9edc5a103d690639c94628824f5 | cat.txt 19 | 933d86ae930c9a5d6d3a334297d9e72852f05c57 | cat.txt:finances.csv 20 | 83f86c0ba1d2d5d60d055064256cd95a5ae6bb7d | cat.txt:finances.csv:joke.txt 21 | ba2e8af09b57080549180a32ac1ff1dde4d30b14 | cat.txt:joke.txt 22 | 0b939251f4c781f43efef804ee8faec0212f1144 | finances.csv 23 | 4b0972ec7282ad9e991414d1845ceee546eac7a1 | finances.csv:joke.txt 24 | 715b21027dca61235e2663e59a9bdfb387ca7997 | joke.txt 25 | 26 | Can you access any file you're not supposed to? 27 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # sca 1 - piece of scake 3 | # simple aes sca challenge without any delays 4 | # define DRANDOM_DELAY to enable random delays 5 | # define DTRIGGER=1 to enable a trigger right before entering aes_enc() 6 | simplesca: CHNAME=simplesca 7 | simplesca: OBJECTS=$(addprefix bin/,$(SERIAL) $(AESPROTECTED) $(SIMPLESCA)) aes/gf256mul.S 8 | simplesca: ADDFLAGS=-Iserial -Iaesprotected -DDELAYSIZE=0x0 -DTRIGGER=1 -DENABLE_RANDOMDELAY=0 -DENABLE_DUMMYROUNDS=0 -DENABLE_ANTIDFA=0 -DAES_ENCRYPTION=0 9 | simplesca: serial aesprotected1 $(addprefix simplesca/,$(SIMPLESCA)) 10 | simplesca: simplesca.enc.hex 11 | 12 | # sca 2 - still not scary 13 | mediumsca: CHNAME=mediumsca 14 | mediumsca: OBJECTS=$(addprefix bin/,$(SERIAL) $(AESPROTECTED) $(MEDIUMSCA)) aes/gf256mul.S 15 | mediumsca: ADDFLAGS=-Iserial -Iaesprotected -DDELAYSIZE=0x0 -DTRIGGER=0 -DENABLE_RANDOMDELAY=1 16 | mediumsca: serial aesprotected2 $(addprefix mediumsca/,$(MEDIUMSCA)) 17 | mediumsca: mediumsca.enc.hex 18 | 19 | # sca 3 - wow that escalated quickly 20 | hardsca: CHNAME=hardsca 21 | hardsca: OBJECTS=$(addprefix bin/,$(SERIAL) $(AESPROTECTED) $(HARDSCA)) aes/gf256mul.S 22 | hardsca: ADDFLAGS=-Iserial -Iaesprotected -DDELAYSIZE=0x0 -DTRIGGER=0 -DENABLE_RANDOMDELAY=1 -DENABLE_DUMMYROUNDS=1 -DENABLE_ANTIDFA=1 -DAES_ENCRYPTION=1 23 | hardsca: serial aesprotected3 $(addprefix hardsca/,$(HARDSCA)) 24 | hardsca: hardsca.enc.hex 25 | -------------------------------------------------------------------------------- /challenges/binaries/fine_tuning/fine_tuning_readme.txt: -------------------------------------------------------------------------------- 1 | Elias Öberson @DrAndroid1337 - Nov 2 2 | I hacked this device! I unlocked it! 3 | 4 | Elias Öberson @DrAndroid1337 - Nov 2 5 | It was easy to break this strange device, but unfortunately I don't 6 | understand how it works. It doesn't seem to do anything. Any 7 | suggestion? 8 | 9 | Elias Öberson @DrAndroid1337 - Nov 3 10 | Again! I found a similar device in the street! Who is the fool that 11 | keeps losing these "pendrives"!? 12 | 13 | Elias Öberson @DrAndroid1337 - Nov 3 14 | It looks the same but now it has a "V2" mark. There is nothing good on 15 | TV tonight so I will take a look at this. 16 | 17 | Elias Öberson @DrAndroid1337 - Nov 3 18 | It's not locked! That's good! Maybe I can find what it 19 | does. Unfortunately it asks for a password but I think I can bypass it 20 | using FI again. 21 | 22 | Elias Öberson @DrAndroid1337 - Nov 4 23 | The "V1" was very easy to break but this one... A couple of hours 24 | already and still nothing. 25 | 26 | Elias Öberson @DrAndroid1337 - Nov 4 27 | OK! It's 3AM. I think I will continue tomorrow. 28 | 29 | Elias Öberson @DrAndroid1337 - Nov 4 30 | I cannot sleep. Somebody keeps calling my landline. They do not say 31 | anything but I can hear them breathing. 32 | 33 | Elias Öberson @DrAndroid1337 - Nov 4 34 | I disconnected the phone but the moron has my mobile! I am sure it is 35 | @Leneko2015, bored at home. 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rhme-2016 2 | 3 | ## Challenge Binaries 4 | 5 | You can use the challenge binaries on a normal Arduino Nano or Uno board (atmega328p chip). To upload the challenge to the board, use the following command: 6 | 7 | avrdude -c arduino -p atmega328p -P /dev/ttyUSB* -b115200 -u -V -U flash:w:CHALLENGE.hex 8 | 9 | Please keep in mind that depending on the bootloader that is installed on your board, the baudrate will change. Stock Nano baudrate should be 57600, and stock Uno is 115200. (Thanks [HydraBus]kag for this info). 10 | 11 | ## Write-ups 12 | * https://github.com/hydrabus/rhme-2016 13 | * https://www.balda.ch/posts/2017/Mar/01/rhme2-writeup/ 14 | * https://www.youtube.com/playlist?list=PLhixgUqwRTjwNaT40TqIIagv3b4_bfB7M 15 | * https://ctf.rip/rhme2-secretsauce/ 16 | * https://ctf.rip/rhme2-fridgejit/ 17 | * https://github.com/mrmacete/writeups/tree/master/rhme2/fridge-plugin 18 | * https://github.com/gijsh/rhme2_writeups 19 | * https://www.youtube.com/watch?v=6_Z5RcHoykE 20 | * https://n0wblog.blogspot.nl/2017/03/rhme2-writeups-secure-filesystem.html 21 | * https://n0wblog.blogspot.nl/2017/03/rhme2-writeups-jumpy.html 22 | * https://github.com/ikizhvatov/jlsca-tutorials 23 | * https://firefart.at/post/rhme2_whac_the_mole/ 24 | 25 | ## Old readme 26 | The second round is coming! 27 | 28 | The RHme2 (Riscure Hack me 2) is our low level hardware CTF challenge that comes in the form of an Arduino Nano board. The new edition provides a completely different set of new challenges to test your skills in side channel, fault injection, cryptoanalysis and software exploitation attacks. 29 | 30 | For more information and registration, visit http://rhme.riscure.com 31 | 32 | Follow us on twitter at @riscure and #rhme2 for updates. 33 | -------------------------------------------------------------------------------- /challenges/binaries/fiasco/fiasco_readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Elias Öberson @DrAndroid1337 - Nov 8 3 | Sorry, I have been offline for 3 days. My provider cancelled my 4 | internet subscription by error. 5 | 6 | Elias Öberson @DrAndroid1337 - Nov 8 7 | I finally hacked the "V2" device. It is not that hard once you know 8 | when to inject the glitch. Unfortunately I still don't know how to use 9 | it 10 | 11 | Elias Öberson @DrAndroid1337 - Nov 8 12 | There is no interface, no menus, no options. Only the "Chip 13 | locked. Please write your password:" and then, nothing. 14 | 15 | Elias Öberson @DrAndroid1337 - Nov 8 16 | Please, retweet this photo to see if somebody knows what this device 17 | is. 18 | 19 | Elias Öberson @DrAndroid1337 - Nov 9 20 | NO! AGAIN! 21 | 22 | Elias Öberson @DrAndroid1337 - Nov 9 23 | V3!!! WTF!!! 24 | 25 | Elias Öberson @DrAndroid1337 - Nov 9 26 | THIS CANNOT BE A COINCIDENCE! I AM FREAKING OUT! 27 | 28 | Elias Öberson @DrAndroid1337 - Nov 9 29 | @Leneko2015, is this one of your jokes? Is this a revenge for the day 30 | I triggered your home alarm using the SDR? 31 | 32 | Elias Öberson @DrAndroid1337 - Nov 9 33 | @Leneko2015, I am not playing this game anymore. 34 | 35 | Elias Öberson @DrAndroid1337 - Nov 11 36 | This is weird. I think somebody is following me. 37 | 38 | Elias Öberson @DrAndroid1337 - Nov 11 39 | OK. He was not following me. Maybe I am paranoid lately. 40 | 41 | Elias Öberson @DrAndroid1337 - Nov 12 42 | Grand Cheef McAuto released for the Xstation! I need to play it right 43 | now 44 | 45 | Elias Öberson @DrAndroid1337 - Nov 15 46 | The same guy. Following me!? Or am I just paranoid again? 47 | 48 | Elias Öberson @DrAndroid1337 - Nov 15 49 | HE IS REALLY FOLLOWING ME!!! 50 | 51 | Elias Öberson @DrAndroid1337 - Nov 15 52 | I went to the police. They don't believe me. They said I am paranoid 53 | 54 | Elias Öberson @DrAndroid1337 - Nov 15 55 | Is this all related? The USB devices, the strange phone calls, the 56 | guy. Two days ago I thought there was somebody behind my door. 57 | 58 | Elias Öberson @DrAndroid1337 - Nov 16 59 | I am trying to hack the "V3" device. A password again, but I cannot 60 | bypass it like last time. 61 | 62 | Elias Öberson @DrAndroid1337 - Nov 18 63 | I am not feeling safe anymore. Too many things are happening. I am 64 | going out the city for few days. I take the USB device with me 65 | -------------------------------------------------------------------------------- /src/aesprotected/aesProtected.h: -------------------------------------------------------------------------------- 1 | /* aes.h */ 2 | /* 3 | * This code is/was initially part of the AVR-Crypto-Lib. It is now 4 | * stripped down such that only AES 128 encryption and decryption in 5 | * CBC mode is supported. 6 | * 7 | * Copyright (C) 2016 alegen (alex@alegen.net) 8 | * Copyright (C) 2006-2016 Daniel Otte (bg@nerilex.org) 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | 24 | #ifndef AES_H_ 25 | #define AES_H_ 26 | 27 | #include 28 | 29 | /* 30 | * The three types defined below are already array types 31 | * and work as if they are pointers. No need to dereference 32 | * variables of these types. 33 | */ 34 | 35 | typedef uint8_t* aes_state_t; 36 | typedef uint8_t* aes_iv_t; 37 | typedef uint8_t* aes_roundkey_t; 38 | typedef uint8_t* aes_key_t; 39 | 40 | #define AES_STATE_SIZE 16 41 | #define AES_IV_SIZE 16 42 | #define AES_ROUNDKEY_SIZE 16 43 | #define AES_KEY_SIZE (16 * 11) 44 | 45 | 46 | inline void aes_key_expansion(aes_key_t key); 47 | 48 | #if AES_ENCRYPTION 49 | 50 | inline void aes_ecb_encrypt(aes_state_t data, aes_key_t key); 51 | inline void aes_cbc_encrypt(aes_state_t data, aes_iv_t, aes_key_t key); 52 | 53 | #endif 54 | 55 | inline void aes_ecb_decrypt(aes_state_t data, aes_key_t key); 56 | inline void aes_cbc_decrypt(aes_state_t data, aes_iv_t, aes_key_t key); 57 | 58 | 59 | void delay(uint16_t value); 60 | #define LONGDELAY() delay(0x4FF); 61 | 62 | #if ENABLE_RANDOMDELAY 63 | #define RANDOMDELAY() random_delay(0x007F); 64 | //#define SHORTRANDOMDELAY() random_delay(0x001F); 65 | #define SHORTRANDOMDELAY() ; 66 | void random_delay(uint16_t max_value); 67 | #else 68 | #define RANDOMDELAY() ; 69 | #define SHORTRANDOMDELAY() ; 70 | #endif 71 | 72 | void executeWithDummies(void (*function)(uint8_t *, uint8_t *), uint8_t *data, uint8_t *key); 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/hardsca/hardsca.c: -------------------------------------------------------------------------------- 1 | /* RHme2 2 | * Side Channel Analysis - SCAlate 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "serial_io.h" 13 | #include "aesProtected.h" 14 | 15 | 16 | //For most platforms we want to use the AVR ADC-pins, since they have a seperate power rail 17 | //This can be overridden elsewhere 18 | #if TRIGGER==1 19 | #define trigger_setup() DDRB = 0x20; 20 | #define trigger_high() PORTB |= (1 << PORTB5); 21 | #define trigger_low() PORTB &= ~(1 << PORTB5); 22 | #else 23 | #define trigger_setup() 24 | #define trigger_low() 25 | #define trigger_high() 26 | #endif 27 | 28 | uint8_t key[AES_KEY_SIZE]; 29 | uint8_t buf[AES_STATE_SIZE]; 30 | 31 | void fill_buf() 32 | { 33 | uint8_t i; 34 | 35 | for(i = 0; i < 16; ++i) { 36 | buf[i] = usart_recv_byte(); 37 | } 38 | } 39 | 40 | void send_buf() 41 | { 42 | uint8_t i; 43 | 44 | for(i = 0; i < 16; ++i) { 45 | usart_send_byte(buf[i]); 46 | } 47 | } 48 | 49 | void encrypt() 50 | { 51 | trigger_high(); 52 | aes_ecb_encrypt(buf, key); 53 | trigger_low(); 54 | } 55 | 56 | void decrypt() 57 | { 58 | aes_ecb_decrypt(buf, key); 59 | } 60 | 61 | void aes_setup() 62 | { 63 | uint8_t aux[32] = {0x1c, 0x7b, 0x3f, 0x97, 0x83, 0xa4, 0x72, 0x55, 0xdb, 0x68, 0xb2, 0xd6, 0xe1, 0x9a, 0x9d, 0xd2}; 64 | int i; 65 | 66 | for (i = 0; i < AES_KEY_SIZE; i++) { 67 | key[i] = aux[i]; 68 | } 69 | 70 | memset(aux, 0, sizeof(aux)); 71 | aes_key_expansion(key); 72 | } 73 | 74 | void random_setup() 75 | { 76 | static uint8_t initialized = 0; 77 | // We XOR the stored seed with the input buffer for adding more entropy 78 | // (assuming somebody doing SCA and randomizing the input) 79 | 80 | if (initialized == 0) { 81 | srand(eeprom_read_word(0) ^ (buf[0]<<8 | buf[1])); 82 | initialized = 1; 83 | } 84 | } 85 | 86 | int main(void) 87 | { 88 | 89 | uint8_t command; 90 | 91 | serial_init(); 92 | trigger_setup(); 93 | aes_setup(); 94 | #ifdef DELAYS 95 | random_setup(); 96 | #endif 97 | 98 | while(1) { 99 | command = usart_recv_byte(); 100 | 101 | switch(command) { 102 | case 'e': 103 | fill_buf(); 104 | random_setup(); 105 | encrypt(); 106 | send_buf(); 107 | break; 108 | 109 | case 'd': 110 | fill_buf(); 111 | random_setup(); 112 | decrypt(); 113 | send_buf(); 114 | break; 115 | 116 | default: 117 | continue; 118 | } 119 | } 120 | return 0; 121 | } 122 | -------------------------------------------------------------------------------- /src/mediumsca/mediumsca.c: -------------------------------------------------------------------------------- 1 | /* RHme2 2 | * Side Channel Analysis - Still Not SCAry 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "serial_io.h" 13 | #include "aesProtected.h" 14 | 15 | //For most platforms we want to use the AVR ADC-pins, since they have a seperate power rail 16 | //This can be overridden elsewhere 17 | #if TRIGGER==1 18 | #define trigger_setup() DDRB = 0x20; 19 | #define trigger_high() PORTB |= (1 << PORTB5); 20 | #define trigger_low() PORTB &= ~(1 << PORTB5); 21 | #else 22 | #define trigger_setup() 23 | #define trigger_low() 24 | #define trigger_high() 25 | #endif 26 | 27 | uint8_t key[AES_KEY_SIZE]; 28 | uint8_t buf[AES_STATE_SIZE]; 29 | 30 | void fill_buf() 31 | { 32 | uint8_t i; 33 | 34 | for(i = 0; i < 16; ++i) { 35 | buf[i] = usart_recv_byte(); 36 | } 37 | } 38 | 39 | void send_buf() 40 | { 41 | uint8_t i; 42 | 43 | for(i = 0; i < 16; ++i) { 44 | usart_send_byte(buf[i]); 45 | } 46 | } 47 | 48 | void encrypt() 49 | { 50 | trigger_high(); 51 | aes_ecb_encrypt(buf, key); 52 | trigger_low(); 53 | } 54 | 55 | void decrypt() 56 | { 57 | aes_ecb_decrypt(buf, key); 58 | } 59 | 60 | void aes_setup() 61 | { 62 | uint8_t aux[32] = {0x89, 0x32, 0xd0, 0xb8, 0x10, 0x16, 0x85, 0x14, 0x53, 0x4b, 0x93, 0xbe, 0x48, 0x2c, 0xdf, 0x21}; 63 | int i; 64 | 65 | for (i = 0; i < AES_KEY_SIZE; i++) { 66 | key[i] = aux[i]; 67 | } 68 | 69 | memset(aux, 0, sizeof(aux)); 70 | aes_key_expansion(key); 71 | } 72 | 73 | void random_setup() 74 | { 75 | static uint8_t initialized = 0; 76 | // We XOR the stored seed with the input buffer for adding more entropy 77 | // (assuming somebody doing SCA and randomizing the input) 78 | 79 | if (initialized == 0) { 80 | srand(eeprom_read_word(0) ^ (buf[0]<<8 | buf[1])); 81 | initialized = 1; 82 | } 83 | 84 | } 85 | 86 | int main(void) 87 | { 88 | uint8_t command; 89 | 90 | serial_init(); 91 | trigger_setup(); 92 | aes_setup(); 93 | #ifdef DELAYS 94 | random_setup(); 95 | #endif 96 | while(1) { 97 | command = usart_recv_byte(); 98 | 99 | switch(command) { 100 | case 'e': 101 | fill_buf(); 102 | random_setup(); 103 | encrypt(); 104 | send_buf(); 105 | break; 106 | 107 | case 'd': 108 | fill_buf(); 109 | random_setup(); 110 | decrypt(); 111 | send_buf(); 112 | break; 113 | 114 | default: 115 | continue; 116 | } 117 | } 118 | 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /src/simplesca/simplesca.c: -------------------------------------------------------------------------------- 1 | /* RHme2 2 | * Side Channel Analysis - Piece of SCAke 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "serial_io.h" 13 | #include "aesProtected.h" 14 | 15 | //For most platforms we want to use the AVR ADC-pins, since they have a seperate power rail 16 | //This can be overridden elsewhere 17 | #if TRIGGER==1 18 | #define trigger_setup() DDRB = 0x20; 19 | #define trigger_high() PORTB |= (1 << PORTB5); 20 | #define trigger_low() PORTB &= ~(1 << PORTB5); 21 | #else 22 | #define trigger_setup() 23 | #define trigger_low() 24 | #define trigger_high() 25 | #endif 26 | 27 | uint8_t key[AES_KEY_SIZE]; 28 | uint8_t buf[AES_STATE_SIZE]; 29 | 30 | void fill_buf() 31 | { 32 | uint8_t i; 33 | 34 | for(i = 0; i < 16; ++i) { 35 | buf[i] = usart_recv_byte(); 36 | } 37 | } 38 | 39 | void send_buf() 40 | { 41 | uint8_t i; 42 | 43 | for(i = 0; i < 16; ++i) { 44 | usart_send_byte(buf[i]); 45 | } 46 | } 47 | 48 | void encrypt() 49 | { 50 | trigger_high(); 51 | aes_ecb_encrypt(buf, key); 52 | trigger_low(); 53 | } 54 | 55 | void decrypt() 56 | { 57 | trigger_high(); 58 | aes_ecb_decrypt(buf, key); 59 | trigger_low(); 60 | } 61 | 62 | void aes_setup() 63 | { 64 | uint8_t aux[32] = {0xaf, 0x23, 0xd5, 0x45, 0xa0, 0xea, 0xe6, 0xa0, 0x74, 0x65, 0x96, 0xca, 0xce, 0x51, 0xf0, 0xf7}; 65 | int i; 66 | 67 | for (i = 0; i < AES_KEY_SIZE; i++) { 68 | key[i] = aux[i]; 69 | } 70 | 71 | memset(aux, 0, sizeof(aux)); 72 | aes_key_expansion(key); 73 | } 74 | 75 | void random_setup() 76 | { 77 | static uint8_t initialized = 0; 78 | // We XOR the stored seed with the input buffer for adding more entropy 79 | // (assuming somebody doing SCA and randomizing the input) 80 | if (initialized == 0) { 81 | srand(eeprom_read_word(0) ^ (buf[0]<<8 | buf[1])); 82 | initialized = 1; 83 | } 84 | 85 | } 86 | 87 | int main(void) 88 | { 89 | uint8_t command; 90 | 91 | serial_init(); 92 | trigger_setup(); 93 | aes_setup(); 94 | 95 | while(1) { 96 | command = usart_recv_byte(); 97 | 98 | switch(command) { 99 | case 'e': 100 | fill_buf(); 101 | random_setup(); 102 | encrypt(); 103 | send_buf(); 104 | break; 105 | 106 | case 'd': 107 | fill_buf(); 108 | random_setup(); 109 | decrypt(); 110 | send_buf(); 111 | 112 | break; 113 | default: 114 | continue; 115 | } 116 | } 117 | 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /src/aesprotected/gf256mul.S: -------------------------------------------------------------------------------- 1 | /* gf256mul.S */ 2 | /* 3 | * This file is part of the AVR-Crypto-Lib. 4 | * Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) 5 | * 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. 10 | * 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. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* 21 | * For reference, the meaning of the 'f' character in behind labels in branch 22 | * instruction refers to local labels. Read more about it here: 23 | * http://www.atmel.com/webdoc/AVRLibcReferenceManual/FAQ_1faq_asmstabs.html 24 | * 25 | * The algorithm used in this implementation is the Russian Peasant 26 | * Multiplication algorithm. Read more about it here: 27 | * https://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication 28 | */ 29 | 30 | #include 31 | #define OPTIMIZE_SMALL_A 32 | 33 | /* 34 | * param a: r24 35 | * param b: r22 36 | * param reducer: r20 37 | * return value: r24 38 | */ 39 | 40 | /* 41 | * aliases for registers 42 | */ 43 | A = 23 44 | B = 22 45 | P = 24 46 | 47 | .global gf256mul 48 | 49 | #ifdef OPTIMIZE_SMALL_A 50 | 51 | gf256mul: 52 | ; A = r24 53 | mov A, r24 54 | ; r24 = 0 55 | clr r24 56 | 1: 57 | ; A >> 1 58 | ; bit 0 is loaded into the C flag 59 | ; if result is 0, the Z flag is set 60 | lsr A 61 | ; branch if Z flag is set 62 | breq 4f 63 | ; branch if C flag is cleared 64 | brcc 2f 65 | ; P = P xor B 66 | eor P, B 67 | 2: 68 | ; B << 1 69 | ; bit 7 is loaded into the C flag 70 | ; if result is 0, the Z flag is set 71 | lsl B 72 | ; branch if C flag is cleared 73 | brcc 3f 74 | ; B = B xor r20 75 | eor B, r20 76 | 3: 77 | rjmp 1b 78 | 4: 79 | ; branch if C flag is cleared 80 | brcc 2f 81 | ; P = P xor B 82 | eor P, B 83 | 2: 84 | ret 85 | 86 | #else // OPTIMIZE_SMALL_A not defined 87 | 88 | gf256mul: 89 | ; A = r24 90 | mov A, r24 91 | ; r24 = 0 92 | clr r24 93 | ; r25 = 0 94 | ldi r25, 8 95 | 1: 96 | ; A >> 1 97 | ; bit 0 is loaded into the C flag 98 | ; if result is 0, the Z flag is set 99 | lsr A 100 | ; branch if C flag is cleared 101 | brcc 2f 102 | ; P = P xor B 103 | eor P, B 104 | 2: 105 | ; B << 1 106 | lsl B 107 | ; branch if C flag is cleared 108 | brcc 3f 109 | ; B = B xor r20 110 | eor B, r20 111 | 3: 112 | ; r25 -= 1 113 | ; if result is 0, the Z flag is set 114 | dec r25 115 | ; branch if Z flag is not set 116 | brne 1b 117 | ret 118 | 119 | #endif // OPTIMIZE_SMALL_A 120 | -------------------------------------------------------------------------------- /challenges/binaries/fiesta/fiesta.hex: -------------------------------------------------------------------------------- 1 | :100000000C9434000C9451000C9451000C94510049 2 | :100010000C9451000C9451000C9451000C9451001C 3 | :100020000C9451000C9451000C9451000C9451000C 4 | :100030000C9451000C9451000C9451000C945100FC 5 | :100040000C9451000C9451000C9451000C945100EC 6 | :100050000C9451000C9451000C9451000C945100DC 7 | :100060000C9451000C94510011241FBECFEFD8E026 8 | :10007000DEBFCDBF11E0A0E0B1E0E8EFF7E002C0E5 9 | :1000800005900D92AE34B107D9F721E0AEE4B1E0AE 10 | :1000900001C01D92A63CB207E1F70E94CD000C946E 11 | :1000A000FA030C940000CF93DF9300D0CDB7DEB7F6 12 | :1000B000CE0109969A83898329813A818F81988517 13 | :1000C000AC0168E770E08EE491E00E9419018EE4D3 14 | :1000D00091E00E94AF000F900F90DF91CF910895B3 15 | :1000E000CF93DF9300D0CDB7DEB783E390E09A8360 16 | :1000F000898385EC90E029813A81232F3327FC0105 17 | :10010000208384EC90E02981FC01208381EC90E045 18 | :1001100028E1FC01208382EC90E026E0FC012083B2 19 | :100120000F900F90DF91CF910895CF93DF931F929F 20 | :10013000CDB7DEB78983000080EC90E0FC018081C0 21 | :10014000882F90E080729927892BB1F386EC90E09C 22 | :100150002981FC0120830F90DF91CF910895CF93E7 23 | :10016000DF9300D0CDB7DEB79A8389830BC0898136 24 | :100170009A819C012F5F3F4F3A832983FC01808144 25 | :100180000E94950089819A81FC018081882379F7FA 26 | :100190000F900F90DF91CF910895CF93DF9300D010 27 | :1001A0001F92CDB7DEB71B821A8219820E9470009F 28 | :1001B00080E091E0892F8F9380E091E08F930E94FF 29 | :1001C00053000F900F9014C089819A8101969A83F1 30 | :1001D000898389819A81892B59F483E291E0892F5F 31 | :1001E0008F9383E291E08F930E9453000F900F90C2 32 | :1001F0008B81882349F388E291E0892F8F9388E2ED 33 | :1002000091E08F930E9453000F900F9088E391E04C 34 | :10021000892F8F9388E391E08F930E9453000F9072 35 | :100220000F9080E090E00F900F900F90DF91CF91B2 36 | :100230000895AEE0B0E0EFE1F1E00C94D1038C0161 37 | :10024000CA0146E04C831A83098377FF02C060E04D 38 | :1002500070E8FB013197FE83ED83A901BC01CE015B 39 | :1002600001960E9445014D815E8157FD0AC02F8194 40 | :100270003885421753070CF49A01F801E20FF31F77 41 | :1002800010822E96E4E00C94ED03ACE0B0E0EBE4D9 42 | :10029000F1E00C94C3037C016B018A01FC0117821D 43 | :1002A0001682838181FFBDC1CE0101964C01F70109 44 | :1002B0009381F60193FD859193FF81916F018823CE 45 | :1002C00009F4ABC1853239F493FD859193FF819197 46 | :1002D0006F01853229F4B70190E00E942D03E7CF2A 47 | :1002E000512C312C20E02032A0F48B3269F030F414 48 | :1002F000803259F0833269F420612CC08D3239F09C 49 | :10030000803339F4216026C02260246023C0286035 50 | :1003100021C027FD27C030ED380F3A3078F426FF92 51 | :1003200006C0FAE05F9E300D1124532E13C08AE000 52 | :10033000389E300D1124332E20620CC08E3221F4F1 53 | :1003400026FD6BC1206406C08C3611F4206802C003 54 | :10035000883641F4F60193FD859193FF81916F01F9 55 | :100360008111C1CF982F9F7D9554933028F40C5F55 56 | :100370001F4FFFE3F9830DC0833631F0833771F0EF 57 | :10038000833509F05BC022C0F801808189830E5F4C 58 | :100390001F4F44244394512C540115C03801F2E0FE 59 | :1003A0006F0E711CF801A080B18026FF03C0652D7F 60 | :1003B00070E002C06FEF7FEFC5012C870E9422031F 61 | :1003C0002C0183012C852F77222E17C03801F2E0F3 62 | :1003D0006F0E711CF801A080B18026FF03C0652D4F 63 | :1003E00070E002C06FEF7FEFC5012C870E941703FA 64 | :1003F0002C012C852068222E830123FC1BC0832D19 65 | :1004000090E048165906B0F4B70180E290E00E94EF 66 | :100410002D033A94F4CFF50127FC859127FE8191B5 67 | :100420005F01B70190E00E942D0331103A94F1E092 68 | :100430004F1A51084114510471F7E5C0843611F088 69 | :10044000893639F5F80127FF07C060817181828103 70 | :1004500093810C5F1F4F08C060817181072E000CD3 71 | :10046000880B990B0E5F1F4F2F76722E97FF09C0D6 72 | :1004700090958095709561957F4F8F4F9F4F206825 73 | :10048000722E2AE030E0A4010E946503A82EA8186D 74 | :1004900044C0853729F42F7EB22E2AE030E025C0F3 75 | :1004A000F22FF97FBF2E8F36C1F018F4883579F01E 76 | :1004B000B4C0803719F0883721F0AFC02F2F2061EA 77 | :1004C000B22EB4FE0DC08B2D8460B82E09C024FF5F 78 | :1004D0000AC09F2F9660B92E06C028E030E005C004 79 | :1004E00020E130E002C020E132E0F801B7FE07C0B1 80 | :1004F00060817181828193810C5F1F4F06C0608192 81 | :10050000718180E090E00E5F1F4FA4010E9465039F 82 | :10051000A82EA818FB2DFF777F2E76FE0BC0372D57 83 | :100520003E7FA51450F474FE0AC072FC08C0372D3B 84 | :100530003E7E05C0BA2C372D03C0BA2C01C0B52CA5 85 | :1005400034FF0DC0FE01EA0DF11D8081803311F4EE 86 | :10055000397E09C032FF06C0B394B39404C0832F20 87 | :10056000867809F0B39433FD13C030FF06C05A2CCF 88 | :10057000B31418F4530C5B18B32CB31468F4B7011C 89 | :1005800080E290E03C870E942D03B3943C85F5CF38 90 | :10059000B31410F43B1801C0312C34FF12C0B70162 91 | :1005A00080E390E03C870E942D033C8532FF17C01A 92 | :1005B00031FD03C088E790E002C088E590E0B70114 93 | :1005C0000CC0832F867859F031FF02C08BE201C046 94 | :1005D00080E237FD8DE2B70190E00E942D03A51463 95 | :1005E00038F4B70180E390E00E942D035A94F7CFCE 96 | :1005F000AA94F401EA0DF11D8081B70190E00E94F8 97 | :100600002D03A110F5CF332009F451CEB70180E2BC 98 | :1006100090E00E942D033A94F6CFF70186819781EE 99 | :1006200002C08FEF9FEF2C96E2E10C94DF03FC01F8 100 | :100630000590615070400110D8F7809590958E0F0D 101 | :100640009F1F0895FC016150704001900110D8F780 102 | :10065000809590958E0F9F1F08950F931F93CF93B2 103 | :10066000DF93FB01238121FD03C08FEF9FEF28C0A3 104 | :1006700022FF16C0468157812481358142175307D6 105 | :1006800044F4A081B1819D012F5F3F4F31832083CE 106 | :100690008C93268137812F5F3F4F3783268310C08D 107 | :1006A000EB01092F182F0084F185E02D0995892B86 108 | :1006B000E1F68E819F8101969F838E83812F902FFB 109 | :1006C000DF91CF911F910F910895FA01AA27283049 110 | :1006D00051F1203181F1E8946F936E7F6E5F7F4F0F 111 | :1006E0008F4F9F4FAF4FB1E03ED0B4E03CD0670F8B 112 | :1006F000781F891F9A1FA11D680F791F8A1F911DDE 113 | :10070000A11D6A0F711D811D911DA11D20D009F42D 114 | :1007100068943F912AE0269F11243019305D31936F 115 | :10072000DEF6CF010895462F4770405D4193B3E058 116 | :100730000FD0C9F7F6CF462F4F70405D4A3318F0FF 117 | :10074000495D31FD4052419302D0A9F7EACFB4E0B0 118 | :10075000A6959795879577956795BA95C9F7009768 119 | :100760006105710508959B01AC010A2E0694579509 120 | :10077000479537952795BA95C9F7620F731F841F60 121 | :10078000951FA01D08952F923F924F925F926F92F6 122 | :100790007F928F929F92AF92BF92CF92DF92EF9211 123 | :1007A000FF920F931F93CF93DF93CDB7DEB7CA1B92 124 | :1007B000DB0B0FB6F894DEBF0FBECDBF09942A88BD 125 | :1007C000398848885F846E847D848C849B84AA8465 126 | :1007D000B984C884DF80EE80FD800C811B81AA81F2 127 | :1007E000B981CE0FD11D0FB6F894DEBF0FBECDBFBD 128 | :0807F000ED010895F894FFCF1C 129 | :1007F80052484D4532204649206C6576656C20315B 130 | :100808002E0D0A0D0A43686970207374617475733C 131 | :100818003A20004C6F636B004368697020756E6CFA 132 | :100828006F636B65640D0A00464C41473A20576870 133 | :0E083800795F346D5F495F686572333F000081 134 | :00000001FF 135 | -------------------------------------------------------------------------------- /src/whac_the_mole/whack_the_mole.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define USART_BAUDRATE 19200 12 | #define BAUD_PRESCALER ( (F_CPU / (USART_BAUDRATE * 16UL)) - 1) 13 | #define KB_ENTER 0x0D 14 | 15 | char str[100]; 16 | int numbers [6]; 17 | 18 | 19 | /** 20 | * @brief Send a single byte. 21 | * @param[in] byte Byte to send 22 | */ 23 | void usart_send_byte(uint8_t byte) { 24 | /* Wait for empty transmit buffer */ 25 | while ( !(UCSR0A & (1 << UDRE0)) ) { 26 | } 27 | 28 | /* Send byte */ 29 | UDR0 = byte; 30 | } 31 | 32 | 33 | /** 34 | * @brief Configure the USART0 port. 35 | */ 36 | void serial_init(void) 37 | { 38 | /* Set baud rate */ 39 | //uint16_t baud = BAUD_PRESCALER; 40 | UBRR0H = (uint8_t)0; 41 | UBRR0L = (uint8_t)51; 42 | 43 | /* Enable received and transmitter */ 44 | UCSR0B = (1 << RXEN0) | (1 << TXEN0); 45 | 46 | /* Set frame format (8N1) */ 47 | UCSR0C = (1 << UCSZ00) | (1 << UCSZ01); 48 | UCSR0C &= ~(1 << UMSEL00); 49 | UCSR0B |= (1 << RXCIE0); 50 | //sei(); 51 | } 52 | 53 | /** 54 | * @brief Transmit a string. 55 | * @param[in] s Null terminated string to send 56 | */ 57 | void usart_print(char *s) 58 | { 59 | //PORTB ^= (1 << PORTB5); 60 | 61 | while (*s != 0) { 62 | usart_send_byte( *(s++) ); 63 | 64 | /* Let the VM breath */ 65 | _delay_ms(1); 66 | } 67 | } 68 | 69 | /** 70 | * @brief Check for incomming data. 71 | * @return 1 If there is data avaliable, 0 otherwise 72 | */ 73 | uint8_t usart_data_available(void) 74 | { 75 | if ( UCSR0A & (1 << RXC0) ) 76 | return 1; 77 | return 0; 78 | } 79 | 80 | /** 81 | * @brief Get incoming data. 82 | * @return Received byte. 83 | */ 84 | uint8_t usart_recv_byte(void) 85 | { 86 | /* Wait until data is available */ 87 | while ( !usart_data_available() ){ 88 | } 89 | 90 | /* Read byte */ 91 | return UDR0; 92 | } 93 | 94 | char prbuff[120]; 95 | void serial_printf(const char *format, ...) { 96 | va_list args; 97 | 98 | va_start(args, format); 99 | vsnprintf(prbuff, 120, format, args); 100 | usart_print(prbuff); 101 | va_end(args); 102 | } 103 | 104 | static uint8_t append_char(char *str, uint8_t ch, uint8_t k, uint8_t max) { 105 | usart_send_byte(ch); 106 | 107 | if (k < max - 1) 108 | str[k++] = ch; 109 | return k; 110 | } 111 | 112 | uint8_t usart_read_str(char *str, uint8_t max) { 113 | uint8_t k, eos, ch; 114 | 115 | k = 0; // index of first free position in the string 116 | eos = 0; // end of string, used as boolean 117 | 118 | while (!eos) { 119 | ch = usart_recv_byte(); 120 | if (ch == '\r') { 121 | eos = 1; 122 | } 123 | else { 124 | k = append_char(str, ch, k, max); 125 | } 126 | } 127 | 128 | // terminate string accordingly 129 | str[k] = '\0'; 130 | 131 | /* return input length */ 132 | return k; 133 | } 134 | 135 | void toggle_led(void) 136 | { 137 | PORTB ^= (1 << PORTB5); 138 | } 139 | 140 | int monitorPins(int timeout) { 141 | int i; 142 | int res; 143 | int pin = -1; 144 | int pinTriggered = 0; 145 | int diff = 0; 146 | while (diff <= timeout && pinTriggered == 0){ 147 | res = (PINB<<8)+PIND; 148 | if (res > 3) { 149 | //serial_printf("Result: %d\r\n", res); 150 | for (i=0;i<6;i++) { 151 | int bit = (res >> (numbers[i])) & 1; 152 | if (bit==1 && pinTriggered == 0) { 153 | pin = numbers[i]; 154 | pinTriggered = 1; 155 | } 156 | else if (bit == 1 && pinTriggered == 1) { 157 | pinTriggered = 2; 158 | pin = -1; 159 | } 160 | } 161 | 162 | } 163 | diff += 20; 164 | _delay_ms(20); 165 | } 166 | return pin; 167 | } 168 | 169 | int whack_it() { 170 | int success; 171 | int blink; 172 | unsigned int rnd; 173 | int timeout; 174 | for (success=0; success<51; success++) { 175 | 176 | 177 | if (success == 0) { 178 | serial_printf("\r\nReady?\r\n"); 179 | _delay_ms(1000); 180 | serial_printf("\r\nGet set!\r\n"); 181 | _delay_ms(1000); 182 | serial_printf("\r\nGO!\r\n"); 183 | timeout = 5000; 184 | } 185 | else { 186 | timeout = timeout / 2; 187 | } 188 | 189 | blink = 1; 190 | rnd = rand() % 6 + 1; 191 | 192 | while (blink <= rnd) { 193 | toggle_led(); 194 | _delay_ms(50); 195 | toggle_led(); 196 | _delay_ms(50); 197 | blink++; 198 | } 199 | _delay_ms(4); 200 | int triggered = monitorPins(timeout); 201 | 202 | if (triggered == numbers[rnd-1]) { 203 | if (success == 50) { 204 | return 0xCAFE; 205 | } 206 | sprintf(str, "Great job. You whacked it. Only %d more to go.\r\n", 50 - success); 207 | usart_print(str); 208 | _delay_ms(50); 209 | 210 | } 211 | else { 212 | usart_print("You missed it. Try again by pressing .\r\n"); 213 | while (usart_recv_byte() != KB_ENTER) {} 214 | success = -1; 215 | } 216 | 217 | } 218 | return 0; 219 | } 220 | 221 | int pins() { 222 | int res = 0; 223 | int i=0; 224 | for (i=0;i<6;i++) { 225 | numbers[i] = -1; 226 | } 227 | i = 0; 228 | int tmp, j; 229 | //usart_print("Pin layout:\r\n"); 230 | while (numbers[5] == -1) { 231 | tmp = rand()%11+2; 232 | for (j=0; j<6;j++) { 233 | if (tmp == numbers[j]) { 234 | break; 235 | } 236 | else if (j==5) { 237 | numbers[i] = tmp; 238 | i++; 239 | res = 0xBABE; 240 | } 241 | } 242 | } 243 | return res; 244 | } 245 | 246 | int random_setup() { 247 | static uint8_t initialized=0; 248 | if (initialized == 0) { 249 | srand(eeprom_read_word(0)); 250 | eeprom_write_word(0, rand() ^ 0xBEEFBEFF); 251 | initialized=1; 252 | return 0xDEAD; 253 | } 254 | return 0; 255 | } 256 | 257 | 258 | int main(void) { 259 | 260 | serial_init(); 261 | 262 | //set LED as output 263 | DDRB = 0x20; 264 | 265 | //return value checking code. 266 | int res; 267 | 268 | serial_printf("\r\nWelcome adventurer.\r\n\r\n"); 269 | serial_printf("We are glad you are here. We are in dire need of assistence.\r\n"); 270 | serial_printf("A huge family of moles have found their way into our yard.\r\n"); 271 | serial_printf("We need you to get rid of all 20 of them.\r\n"); 272 | serial_printf("If you manage to extinguish them all we will greatly reward you.\r\n"); 273 | serial_printf("When you are ready, please step into the yard by pressing \r\n"); 274 | 275 | while (usart_recv_byte() != KB_ENTER) {} 276 | 277 | res = random_setup(); 278 | if (res != 0xDEAD) { 279 | return 0; 280 | } 281 | res = pins(); 282 | if (res != 0xBABE) { 283 | return 0; 284 | } 285 | 286 | //double check here, just in case we glitch this one. 287 | //also, random delay in there, because why not. 288 | res = whack_it(); 289 | if (res == 0xCAFE) { 290 | int i = 0; 291 | int rnd = rand()%500; 292 | while (i < rnd ) { 293 | i++;; 294 | _delay_ms(1); 295 | } 296 | if (~res == 0x3501) { 297 | serial_printf("\r\nWhat? You managed to get them all already?\r\n"); 298 | serial_printf("We are most gratefull for your service.\r\n"); 299 | serial_printf("Please take our most precious belonging.\r\n"); 300 | 301 | serial_printf("FLAG:S4v3d_the_f4rm!"); 302 | 303 | return 0; 304 | } 305 | } 306 | 307 | usart_print("Failed.\r\n"); 308 | 309 | return 0; 310 | } 311 | -------------------------------------------------------------------------------- /src/jumpy/jumpy.c: -------------------------------------------------------------------------------- 1 | /* * main.c 2 | * 3 | * Created on: Jun 3, 2016 4 | * Author: rhme 5 | */ 6 | 7 | 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | #ifdef __AVR__ 18 | #include 19 | 20 | #else 21 | 22 | #include 23 | 24 | #define serial_read(x, y) read(0, x, y) 25 | #define serial_printf(...) printf(__VA_ARGS__);fflush(stdout) 26 | #define serial_init(...) 27 | 28 | #endif 29 | 30 | #define USART_BAUDRATE 19200 31 | #define BAUD_PRESCALER ( (F_CPU / (USART_BAUDRATE * 16UL)) - 1) 32 | 33 | 34 | /** 35 | * @brief Send a single byte. 36 | * @param[in] byte Byte to send 37 | */ 38 | void usart_send_byte(uint8_t byte) { 39 | /* Wait for empty transmit buffer */ 40 | while ( !(UCSR0A & (1 << UDRE0)) ) { 41 | } 42 | 43 | /* Send byte */ 44 | UDR0 = byte; 45 | } 46 | 47 | 48 | /** 49 | * @brief Configure the USART0 port. 50 | */ 51 | void serial_init(void) 52 | { 53 | UBRR0H = (uint8_t)0; 54 | UBRR0L = (uint8_t)51; 55 | 56 | /* Enable received and transmitter */ 57 | UCSR0B = (1 << RXEN0) | (1 << TXEN0); 58 | 59 | /* Set frame format (8N1) */ 60 | UCSR0C = (1 << UCSZ00) | (1 << UCSZ01); 61 | UCSR0C &= ~(1 << UMSEL00); 62 | UCSR0B |= (1 << RXCIE0); 63 | //sei(); 64 | } 65 | 66 | /** 67 | * @brief Transmit a string. 68 | * @param[in] s Null terminated string to send 69 | */ 70 | void usart_print(char *s) 71 | { 72 | //PORTB ^= (1 << PORTB5); 73 | 74 | while (*s != 0) { 75 | usart_send_byte( *(s++) ); 76 | 77 | /* Let the VM breath */ 78 | _delay_ms(1); 79 | } 80 | } 81 | 82 | /** 83 | * @brief Check for incomming data. 84 | * @return 1 If there is data avaliable, 0 otherwise 85 | */ 86 | uint8_t usart_data_available(void) 87 | { 88 | if ( UCSR0A & (1 << RXC0) ) 89 | return 1; 90 | return 0; 91 | } 92 | 93 | 94 | /** 95 | * @brief Get incoming data. 96 | * @return Received byte. 97 | */ 98 | uint8_t usart_recv_byte(void) 99 | { 100 | /* Wait until data is available */ 101 | while ( !usart_data_available() ){ 102 | } 103 | 104 | //usart_send_byte('A'); 105 | 106 | /* Read byte */ 107 | return UDR0; 108 | } 109 | 110 | 111 | 112 | unsigned char input[0x10] = {0}; 113 | uint16_t checks = 0x0; 114 | 115 | uint16_t stuff[256]; // Our ROP chain 116 | 117 | void readinput(){ 118 | unsigned char c; 119 | unsigned int idx; 120 | for(idx=0; idx < sizeof(input)-1; idx++){ 121 | c = usart_recv_byte(); 122 | if (c == '\n' || c == '\r') 123 | break; 124 | //usart_print("Recevied\n"); 125 | input[idx] = c; 126 | } 127 | input[idx] = 0; // NULL terminate 128 | } 129 | 130 | void checklen(){ 131 | unsigned char i = 0; 132 | for(i=0;input[i]; i++); 133 | if (i == 13){ 134 | checks |= 1; 135 | } else { 136 | checks = 0; 137 | } 138 | 139 | } 140 | void check7(){ 141 | if (input[7] + input[8] == '_'+'t'){ 142 | checks |= (1 << 8); 143 | } else { 144 | checks = 0; 145 | } 146 | } 147 | void dummy1() { 148 | if (input[7] * input[8] == input[9] + 'k') { 149 | checks |= (1 << 13); 150 | } else if (input[1] + input[2] + input[13] == 'e'+'y') { 151 | checks |= (1 << 2); 152 | checks |= (1 << 5); 153 | } else { 154 | checks |= (0 << 6); 155 | } 156 | } 157 | void check12(){ 158 | volatile uint8_t i; 159 | for(i=0;input[i];i++); 160 | if (input[12] * i == '3'*13){ 161 | checks |= (1 << 13); 162 | } else { 163 | checks = 0; 164 | } 165 | } 166 | void dummy2() { 167 | if (input[3] + input[5] == input[9] * 'b') { 168 | checks |= (1 << 12); 169 | } else if (input[1] + input[2] + input[13] == 'n'*'i') { 170 | checks |= (0 << 2); 171 | checks |= (1 << 6); 172 | } else { 173 | checks |= (0 << 5); 174 | } 175 | } 176 | void check9(){ 177 | if (input[9] + input[10] == '0'+'_'){ 178 | checks |= (1 << 10); 179 | } else { 180 | checks = 0; 181 | } 182 | } 183 | void check4(){ 184 | if (input[4] * input[5] == '_'*'1'){ 185 | checks |= (1 << 5); 186 | } else { 187 | checks = 0; 188 | } 189 | 190 | } 191 | void dummy3() { 192 | if (input[11] - input[4] == input[7] * '3') { 193 | checks |= (1 << 11); 194 | } else if (input[1] + input[2] + input[13] == '2'*'5') { 195 | checks |= (1 << 3); 196 | checks |= (0 << 5); 197 | } else { 198 | checks |= (0 << 4); 199 | } 200 | } 201 | void check3(){ 202 | if (input[3] + input[4] == '3' +'_'){ 203 | checks |= (1 << 4); 204 | } else { 205 | checks = 0; 206 | } 207 | 208 | } 209 | void check10(){ 210 | if (input[10] * input[11] == 'm'*'_'){ 211 | checks |= (1 << 11); 212 | } else { 213 | checks = 0; 214 | } 215 | } 216 | void dummy4() { 217 | if (input[3] << input[2] == input[12] * 'v') { 218 | checks |= (1 << 10); 219 | } else if (input[1] + input[2] + input[13] == '6'*'q') { 220 | checks |= (1 << 13); 221 | checks |= (1 << 12); 222 | } else { 223 | checks |= (0 << 3); 224 | } 225 | } 226 | void check6(){ 227 | if (input[6] * input[7] == 't'*'_'){ 228 | checks |= (1 << 7); 229 | } else { 230 | checks = 0; 231 | } 232 | } 233 | void check1(){ 234 | if (input[1] + input[2] == 'v' +'1'){ 235 | checks |= (1 << 2); 236 | } else { 237 | checks = 0; 238 | } 239 | 240 | } 241 | void check11(){ 242 | if (input[11] + input[12] == 'm'+'3'){ 243 | checks |= (1 << 12); 244 | } else { 245 | checks = 0; 246 | } 247 | } 248 | void check0(){ 249 | if (input[0]*input[1] == 'g'*'1'){ 250 | checks |= (1 << 1); 251 | } else { 252 | checks = 0; 253 | } 254 | 255 | } 256 | void check2(){ 257 | if (input[2] * input[3] == 'v'*'3'){ 258 | checks |= (1 << 3); 259 | } else { 260 | checks = 0; 261 | } 262 | 263 | } 264 | void check8(){ 265 | if (input[8] * input[9] == 't'*'0'){ 266 | checks |= (1 << 9); 267 | } else { 268 | checks = 0; 269 | } 270 | } 271 | void dummy5() { 272 | if (input[6] >> input[10] == input[6] * 'm') { 273 | checks |= (1 << 13); 274 | } else if (input[1] + input[2] + input[13] == 'y'*'3') { 275 | checks |= (1 << 12); 276 | checks |= (0 << 13); 277 | } else { 278 | checks |= (0 << 2); 279 | } 280 | } 281 | void check5(){ 282 | if (input[5] + input[6] == 't'+'1'){ 283 | checks |= (1 << 6); 284 | } else { 285 | checks = 0; 286 | } 287 | } 288 | void dummy6() { 289 | if (input[2] * input[1] == input[7] * 'u') { 290 | checks |= (1 << 8); 291 | } else if (input[4] + input[1] + input[7] == 's'*'r') { 292 | checks |= (1 << 2); 293 | checks |= (1 << 5); 294 | } else { 295 | checks |= (0 << 1); 296 | } 297 | } 298 | 299 | void final(){ 300 | if ( checks == (1<<14)-1){ 301 | usart_print("\r\nFLAG:D0_you_3ven_ROP?"); 302 | usart_print("\r\n"); 303 | } else { 304 | usart_print("\r\nBetter luck next time!\r\n"); 305 | } 306 | } 307 | 308 | void inline pivot(char *stuff) __attribute__((always_inline)); 309 | 310 | void inline pivot(char *stuff) { 311 | 312 | asm volatile( 313 | //"mov sp, r24\n\t" 314 | "out 0x3D, R24\n\t" // SPL 315 | "out 0x3E, R25\n\t" // SPH 316 | "ret\n\t" 317 | ::); 318 | } 319 | 320 | 321 | void print_text(){ 322 | usart_print("Input: "); 323 | } 324 | 325 | volatile uint16_t ctr = 0; 326 | void infloop(){ 327 | while(1); 328 | } 329 | 330 | void nop(){ 331 | ctr++; 332 | } 333 | 334 | 335 | #define SWAP(x) (( (x) >> 8) | (( (x) & 0xFF)<<8)) 336 | 337 | int main(void) { 338 | volatile uint16_t idx = 256-40; 339 | 340 | memset(stuff, 0x41, sizeof(stuff)); 341 | serial_init(); 342 | 343 | checks = 0; 344 | 345 | //Initialize serial ports 346 | stuff[idx++] = SWAP((uint16_t)&nop); 347 | stuff[idx++] = SWAP((uint16_t)&print_text); 348 | stuff[idx++] = SWAP((uint16_t)&readinput); 349 | stuff[idx++] = SWAP((uint16_t)&checklen); 350 | stuff[idx++] = SWAP((uint16_t)&check7); 351 | stuff[idx++] = SWAP((uint16_t)&check8); 352 | stuff[idx++] = SWAP((uint16_t)&check0); 353 | stuff[idx++] = SWAP((uint16_t)&check2); 354 | stuff[idx++] = SWAP((uint16_t)&check3); 355 | stuff[idx++] = SWAP((uint16_t)&check6); 356 | stuff[idx++] = SWAP((uint16_t)&check5); 357 | stuff[idx++] = SWAP((uint16_t)&check9); 358 | stuff[idx++] = SWAP((uint16_t)&check1); 359 | stuff[idx++] = SWAP((uint16_t)&check10); 360 | stuff[idx++] = SWAP((uint16_t)&check12); 361 | stuff[idx++] = SWAP((uint16_t)&check4); 362 | stuff[idx++] = SWAP((uint16_t)&check11); 363 | stuff[idx++] = SWAP((uint16_t)&final); 364 | stuff[idx++] = SWAP((uint16_t)&infloop); 365 | // stuff[idx++] = SWAP((uint16_t)&dummy1); 366 | // stuff[idx++] = SWAP((uint16_t)&dummy2); 367 | // stuff[idx++] = SWAP((uint16_t)&dummy3); 368 | // stuff[idx++] = SWAP((uint16_t)&dummy4); 369 | // stuff[idx++] = SWAP((uint16_t)&dummy5); 370 | // stuff[idx++] = SWAP((uint16_t)&dummy6); 371 | 372 | pivot((char *)(&stuff[256-40]) - 1); 373 | 374 | return 0; 375 | } 376 | -------------------------------------------------------------------------------- /src/secretsauce/secretsauce.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define __AVR_ATmega328P__ 1 7 | 8 | #include 9 | #include 10 | 11 | #define USART_BAUDRATE 19200 12 | #define BAUD_PRESCALER ( (F_CPU / (USART_BAUDRATE * 16UL)) - 1) 13 | 14 | #include "aes.h" 15 | 16 | 17 | /** 18 | * @brief Send a single byte. 19 | * @param[in] byte Byte to send 20 | */ 21 | void usart_send_byte(uint8_t byte) { 22 | /* Wait for empty transmit buffer */ 23 | while ( !(UCSR0A & (1 << UDRE0)) ) { 24 | } 25 | 26 | /* Send byte */ 27 | UDR0 = byte; 28 | } 29 | 30 | 31 | /** 32 | * @brief Configure the USART0 port. 33 | */ 34 | void serial_init(void) 35 | { 36 | /* Set baud rate */ 37 | UBRR0H = (uint8_t)0; 38 | UBRR0L = (uint8_t)51; 39 | 40 | /* Enable received and transmitter */ 41 | UCSR0B = (1 << RXEN0) | (1 << TXEN0); 42 | 43 | /* Set frame format (8N1) */ 44 | UCSR0C = (1 << UCSZ00) | (1 << UCSZ01); 45 | UCSR0C &= ~(1 << UMSEL00); 46 | UCSR0B |= (1 << RXCIE0); 47 | //sei(); 48 | } 49 | 50 | /** 51 | * @brief Transmit a string. 52 | * @param[in] s Null terminated string to send 53 | */ 54 | void usart_print(char *s) 55 | { 56 | while (*s != 0) { 57 | usart_send_byte( *(s++) ); 58 | 59 | /* Let the VM breathe */ 60 | _delay_ms(1); 61 | } 62 | } 63 | 64 | /** 65 | * @brief Check for incomming data. 66 | * @return 1 If there is data avaliable, 0 otherwise 67 | */ 68 | uint8_t usart_data_available(void) 69 | { 70 | if ( UCSR0A & (1 << RXC0) ) 71 | return 1; 72 | return 0; 73 | } 74 | 75 | /** 76 | * @brief Get incoming data. 77 | * @return Received byte. 78 | */ 79 | uint8_t usart_recv_byte(void) 80 | { 81 | /* Wait until data is available */ 82 | while ( !usart_data_available() ){ 83 | } 84 | 85 | /* Read byte */ 86 | return UDR0; 87 | } 88 | 89 | char prbuff[120]; 90 | void serial_printf(const char *format, ...) 91 | { 92 | va_list args; 93 | 94 | va_start(args, format); 95 | vsnprintf(prbuff, 120, format, args); 96 | usart_print(prbuff); 97 | va_end(args); 98 | } 99 | 100 | static uint8_t append_char(char *str, uint8_t ch, uint8_t k, uint8_t max) 101 | { 102 | usart_send_byte(ch); 103 | 104 | if (k < max - 1) 105 | str[k++] = ch; 106 | return k; 107 | } 108 | 109 | uint8_t usart_read_str(char *str, uint8_t max) { 110 | uint8_t k, eos, ch; // , ch2 111 | k = 0; // index of first free position in the string 112 | eos = 0; // end of string, used as boolean 113 | while (!eos) { 114 | ch = usart_recv_byte(); 115 | if (ch == '\r') { 116 | eos = 1; 117 | } else if (ch == '\n') { 118 | // do nothing 119 | } else { 120 | k = append_char(str, ch, k, max); 121 | } 122 | } 123 | 124 | // terminate string accordingly 125 | str[k] = '\0'; 126 | 127 | /* return input length */ 128 | return k; 129 | } 130 | 131 | 132 | // Initializes ACD to read the PINS 133 | void InitADC() 134 | { 135 | ADMUX=(1<"); 295 | inpLen = usart_read_str(inputBuff, 20); 296 | if (inpLen < 20) { 297 | inputBuff[inpLen] = '\0'; 298 | 299 | } else { 300 | inputBuff[19] = '\0'; 301 | } 302 | 303 | serial_printf("\nChecking password...\n"); 304 | if (compPasswords(secretPass, inputBuff) == 0) { 305 | serial_printf("Password is incorrect!\n"); 306 | 307 | } else { 308 | serial_printf("Password is correct!\n"); 309 | authL0 = 7; 310 | _delay_ms(500); 311 | break; 312 | } 313 | } 314 | } 315 | 316 | if (authL0 == 7) { 317 | serial_printf("\n\n************************************************\n"); 318 | serial_printf("Authentication complete. Welcome to the system!\n"); 319 | serial_printf("Now you can encrypt messages up to 32 bytes.\n"); 320 | 321 | while (1) { 322 | serial_printf("Input data to encrypt:\n"); 323 | serial_printf("> "); 324 | inpLen = usart_read_str((char *) in, 33); // read up to 32 byte input 325 | 326 | // Append secret flag after 327 | for (i = 0; i < 16; i++) { 328 | in[i+inpLen] = flag[i]; 329 | } 330 | 331 | // Zero the rest just in case 332 | for (i = (16 + inpLen); i < 50; i++) { 333 | in[i] = 0x00; 334 | } 335 | 336 | getNonce(iv); 337 | 338 | serial_printf("\nTrue Random Nonce:\t"); 339 | for (i = 0; i < 16; i++) { 340 | serial_printf("%02x", iv[i]); 341 | } 342 | serial_printf("\n"); 343 | 344 | uint8_t block = 0; 345 | for (i = 0; i < (16 + inpLen); i+=16) { 346 | iv[15] ^= block; // IV XORed with a block counter which is at most 3. 347 | memcpy(enc, iv, 16); 348 | aes_ecb_encrypt(enc, key); 349 | for (j = 0; j < 16; j++) { 350 | res[block*16+j] = enc[j] ^ in[block*16+j]; 351 | } 352 | block++; 353 | } 354 | 355 | serial_printf("Encryption:\t"); 356 | for (i = 0; i < block*16; i++) { 357 | serial_printf("%02x", res[i]); 358 | } 359 | serial_printf("\n"); 360 | } 361 | } 362 | free(key); 363 | return 0; 364 | } 365 | -------------------------------------------------------------------------------- /challenges/binaries/fine_tuning/fine_tuning.hex: -------------------------------------------------------------------------------- 1 | :100000000C9434000C9451000C9451000C94510049 2 | :100010000C9451000C9451000C9451000C9451001C 3 | :100020000C9451000C9451000C9451000C9451000C 4 | :100030000C9451000C9451000C9451000C945100FC 5 | :100040000C9451000C9451000C9451000C945100EC 6 | :100050000C9451000C9451000C9451000C945100DC 7 | :100060000C9451000C94510011241FBECFEFD8E026 8 | :10007000DEBFCDBF11E0A0E0B1E0EAE0FBE002C0EE 9 | :1000800005900D92A637B107D9F722E0A6E7B1E0B7 10 | :1000900001C01D92A031B207E1F70E9481010C94CA 11 | :1000A00083050C940000CF93DF9300D0CDB7DEB76B 12 | :1000B000CE0109969A83898329813A818F81988517 13 | :1000C000AC0168E770E087E791E00E94290287E7CA 14 | :1000D00091E00E94AF000F900F90DF91CF910895B3 15 | :1000E000CF93DF9300D0CDB7DEB783E390E09A8360 16 | :1000F000898385EC90E029813A81232F3327FC0105 17 | :10010000208384EC90E02981FC01208381EC90E045 18 | :1001100028E1FC01208382EC90E026E0FC012083B2 19 | :100120000F900F90DF91CF910895CF93DF931F929F 20 | :10013000CDB7DEB78983000080EC90E0FC018081C0 21 | :10014000882F90E080729927892BB1F386EC90E09C 22 | :100150002981FC0120830F90DF91CF910895CF93E7 23 | :10016000DF9300D0CDB7DEB79A8389830BC0898136 24 | :100170009A819C012F5F3F4F3A832983FC01808144 25 | :100180000E94950089819A81FC018081882379F7FA 26 | :100190000F900F90DF91CF910895CF93DF93CDB75C 27 | :1001A000DEB780EC90E0FC018081882314F481E0CC 28 | :1001B00001C080E0DF91CF910895CF93DF93CDB759 29 | :1001C000DEB700000E94CD008823E1F386EC90E0CA 30 | :1001D000FC018081DF91CF910895CF93DF93CDB75C 31 | :1001E000DEB780917601882349F480E090E00E9498 32 | :1001F000D3040E941E0281E080937601DF91CF91AB 33 | :1002000008950F931F93CF93DF931F92CDB7DEB75F 34 | :100210000E94ED0019820EC08981082F10E00E9413 35 | :100220001902282FC80181519E4FFC01208389812A 36 | :100230008F5F89838981803178F30F90DF91CF912F 37 | :100240001F910F910895CF93DF9300D0CDB7DEB704 38 | :10025000198216C00E94DD008A838A818D3009F4DC 39 | :100260000CC08A818A3009F40EC08981882F90E001 40 | :1002700081509E4F2A81FC01208389818F5F898371 41 | :100280008981803138F30F900F90DF91CF910895DD 42 | :10029000CF93DF93CDB7DEB727970FB6F894DEBFC5 43 | :1002A0000FBECDBF9C838B837E836D834F831A8269 44 | :1002B000198219C08B819C81FC0120818D819E81D6 45 | :1002C000FC01808182279A81892B8A838B819C8182 46 | :1002D00001969C838B838D819E8101969E838D8365 47 | :1002E00089818F5F898399818F81981718F38A811B 48 | :1002F00027960FB6F894DEBF0FBECDBFDF91CF912A 49 | :100300000895CF93DF931F92CDB7DEB719820E9475 50 | :1003100070000E94010184E091E0892F8F9384E0B6 51 | :1003200091E08F930E9453000F900F908AE191E02B 52 | :10033000892F8F938AE191E08F930E9453000F9051 53 | :100340000F900E94230140E16FEE71E08FEF91E08A 54 | :100350000E944801882311F481E0898389818823E0 55 | :1003600029F384E491E0892F8F9384E491E08F93C3 56 | :100370000E9453000F900F9084E591E0892F8F9396 57 | :1003800084E591E08F930E9453000F900F9080E0DE 58 | :1003900090E00F90DF91CF9108958F929F92AF924E 59 | :1003A000BF92CF92DF92EF92FF92CF93DF93EC0157 60 | :1003B000688179818A819B8161157105810591052B 61 | :1003C00021F464E279ED8BE597E02DE133EF41E034 62 | :1003D00050E00E94E90449015A019B01AC01A7EADF 63 | :1003E000B1E40E9408056B017C01ACEEB4EFA501FD 64 | :1003F00094010E941605DC01CB018C0D9D1DAE1DE4 65 | :10040000BF1DB7FF03C00197A109B0488883998336 66 | :10041000AA83BB839F77DF91CF91FF90EF90DF900E 67 | :10042000CF90BF90AF909F908F9008950E94CD0184 68 | :10043000089580E091E00E94CD010895A0E0B0E031 69 | :100440008093000190930101A0930201B0930301F6 70 | :100450000895AEE0B0E0EFE2F2E00C9429058C01E3 71 | :10046000CA0146E04C831A83098377FF02C060E02B 72 | :1004700070E8FB013197FE83ED83A901BC01CE0139 73 | :1004800001960E9455024D815E8157FD0AC02F8161 74 | :100490003885421753070CF49A01F801E20FF31F55 75 | :1004A00010822E96E4E00C944505ACE0B0E0EBE55C 76 | :1004B000F2E00C941B057C016B018A01FC011782A0 77 | :1004C0001682838181FFBDC1CE0101964C01F701E7 78 | :1004D0009381F60193FD859193FF81916F018823AC 79 | :1004E00009F4ABC1853239F493FD859193FF819175 80 | :1004F0006F01853229F4B70190E00E943D04E7CFF7 81 | :10050000512C312C20E02032A0F48B3269F030F4F1 82 | :10051000803259F0833269F420612CC08D3239F079 83 | :10052000803339F4216026C02260246023C0286013 84 | :1005300021C027FD27C030ED380F3A3078F426FF70 85 | :1005400006C0FAE05F9E300D1124532E13C08AE0DE 86 | :10055000389E300D1124332E20620CC08E3221F4CF 87 | :1005600026FD6BC1206406C08C3611F4206802C0E1 88 | :10057000883641F4F60193FD859193FF81916F01D7 89 | :100580008111C1CF982F9F7D9554933028F40C5F33 90 | :100590001F4FFFE3F9830DC0833631F0833771F0CD 91 | :1005A000833509F05BC022C0F801808189830E5F2A 92 | :1005B0001F4F44244394512C540115C03801F2E0DC 93 | :1005C0006F0E711CF801A080B18026FF03C0652D5D 94 | :1005D00070E002C06FEF7FEFC5012C870E943204EC 95 | :1005E0002C0183012C852F77222E17C03801F2E0D1 96 | :1005F0006F0E711CF801A080B18026FF03C0652D2D 97 | :1006000070E002C06FEF7FEFC5012C870E942704C6 98 | :100610002C012C852068222E830123FC1BC0832DF6 99 | :1006200090E048165906B0F4B70180E290E00E94CD 100 | :100630003D043A94F4CFF50127FC859127FE819182 101 | :100640005F01B70190E00E943D0431103A94F1E05F 102 | :100650004F1A51084114510471F7E5C0843611F066 103 | :10066000893639F5F80127FF07C0608171818281E1 104 | :1006700093810C5F1F4F08C060817181072E000CB1 105 | :10068000880B990B0E5F1F4F2F76722E97FF09C0B4 106 | :1006900090958095709561957F4F8F4F9F4F206803 107 | :1006A000722E2AE030E0A4010E947504A82EA8183A 108 | :1006B00044C0853729F42F7EB22E2AE030E025C0D1 109 | :1006C000F22FF97FBF2E8F36C1F018F4883579F0FC 110 | :1006D000B4C0803719F0883721F0AFC02F2F2061C8 111 | :1006E000B22EB4FE0DC08B2D8460B82E09C024FF3D 112 | :1006F0000AC09F2F9660B92E06C028E030E005C0E2 113 | :1007000020E130E002C020E132E0F801B7FE07C08E 114 | :1007100060817181828193810C5F1F4F06C060816F 115 | :10072000718180E090E00E5F1F4FA4010E9475046C 116 | :10073000A82EA818FB2DFF777F2E76FE0BC0372D35 117 | :100740003E7FA51450F474FE0AC072FC08C0372D19 118 | :100750003E7E05C0BA2C372D03C0BA2C01C0B52C83 119 | :1007600034FF0DC0FE01EA0DF11D8081803311F4CC 120 | :10077000397E09C032FF06C0B394B39404C0832FFE 121 | :10078000867809F0B39433FD13C030FF06C05A2CAD 122 | :10079000B31418F4530C5B18B32CB31468F4B701FA 123 | :1007A00080E290E03C870E943D04B3943C85F5CF05 124 | :1007B000B31410F43B1801C0312C34FF12C0B70140 125 | :1007C00080E390E03C870E943D043C8532FF17C0E7 126 | :1007D00031FD03C088E790E002C088E590E0B701F2 127 | :1007E0000CC0832F867859F031FF02C08BE201C024 128 | :1007F00080E237FD8DE2B70190E00E943D04A51430 129 | :1008000038F4B70180E390E00E943D045A94F7CF9A 130 | :10081000AA94F401EA0DF11D8081B70190E00E94D5 131 | :100820003D04A110F5CF332009F451CEB70180E289 132 | :1008300090E00E943D043A94F6CFF70186819781BB 133 | :1008400002C08FEF9FEF2C96E2E10C943705FC017C 134 | :100850000590615070400110D8F7809590958E0FEB 135 | :100860009F1F0895FC016150704001900110D8F75E 136 | :10087000809590958E0F9F1F08950F931F93CF9390 137 | :10088000DF93FB01238121FD03C08FEF9FEF28C081 138 | :1008900022FF16C0468157812481358142175307B4 139 | :1008A00044F4A081B1819D012F5F3F4F31832083AC 140 | :1008B0008C93268137812F5F3F4F3783268310C06B 141 | :1008C000EB01092F182F0084F185E02D0995892B64 142 | :1008D000E1F68E819F8101969F838E83812F902FD9 143 | :1008E000DF91CF911F910F910895FA01AA27283027 144 | :1008F00051F1203181F1E8946F936E7F6E5F7F4FED 145 | :100900008F4F9F4FAF4FB1E03ED0B4E03CD0670F68 146 | :10091000781F891F9A1FA11D680F791F8A1F911DBB 147 | :10092000A11D6A0F711D811D911DA11D20D009F40B 148 | :1009300068943F912AE0269F11243019305D31934D 149 | :10094000DEF6CF010895462F4770405D4193B3E036 150 | :100950000FD0C9F7F6CF462F4F70405D4A3318F0DD 151 | :10096000495D31FD4052419302D0A9F7EACFB4E08E 152 | :10097000A6959795879577956795BA95C9F7009746 153 | :100980006105710508959B01AC010A2E06945795E7 154 | :10099000479537952795BA95C9F7620F731F841F3E 155 | :1009A000951FA01D0895A8E1B0E042E050E00C942E 156 | :1009B000DB04DC01CB01FC01F999FECF06C0F2BDDE 157 | :1009C000E1BDF89A319600B40D9241505040B8F70D 158 | :1009D0000895052E97FB1EF400940E94000557FD14 159 | :1009E00007D00E94520507FC03D04EF40C9400057A 160 | :1009F00050954095309521953F4F4F4F5F4F08954B 161 | :100A000090958095709561957F4F8F4F9F4F08957A 162 | :100A10000E947405A59F900DB49F900DA49F800D1A 163 | :100A2000911D11240895B7FF0C9408050E94080534 164 | :100A3000821B930B08952F923F924F925F926F9279 165 | :100A40007F928F929F92AF92BF92CF92DF92EF925E 166 | :100A5000FF920F931F93CF93DF93CDB7DEB7CA1BDF 167 | :100A6000DB0B0FB6F894DEBF0FBECDBF09942A880A 168 | :100A7000398848885F846E847D848C849B84AA84B2 169 | :100A8000B984C884DF80EE80FD800C811B81AA813F 170 | :100A9000B981CE0FD11D0FB6F894DEBF0FBECDBF0A 171 | :100AA000ED010895A1E21A2EAA1BBB1BFD010DC08A 172 | :100AB000AA1FBB1FEE1FFF1FA217B307E407F5070E 173 | :100AC00020F0A21BB30BE40BF50B661F771F881FEA 174 | :100AD000991F1A9469F760957095809590959B0180 175 | :100AE000AC01BD01CF010895A29FB001B39FC00129 176 | :100AF000A39F700D811D1124911DB29F700D811D4A 177 | :0A0B00001124911D0895F894FFCF11 178 | :100B0A000100000052484D4532204649206C657666 179 | :100B1A00656C20322E0D0A0D0A0043686970206C3C 180 | :100B2A006F636B65640D0A506C656173652077723B 181 | :100B3A0069746520796F75722070617373776F724B 182 | :100B4A00643A20004368697020756E6C6F636B6548 183 | :100B5A00640D0A00464C41473A20346C6C207034CC 184 | :100B6A00737377307264732061723320636F7272A9 185 | :060B7A0033637421210029 186 | :00000001FF 187 | -------------------------------------------------------------------------------- /src/jungle/jungle.c: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * RHme2 4 | * Other - Emergency Transmitter 5 | * 6 | */ 7 | 8 | #define F_CPU 16000000UL 9 | #define USART_BAUDRATE 115200 10 | #define BAUD_PRESCALER ( (F_CPU / (USART_BAUDRATE * 16UL)) - 1) 11 | #define INBUFFER_LEN 16 12 | #define CHR_LF 10 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "aes.h" 22 | #include 23 | 24 | 25 | /************************/ 26 | /* Functions prototypes */ 27 | /************************/ 28 | 29 | void usart_send_byte(uint8_t byte); 30 | void serial_init(void); 31 | void usart_print(char *s); 32 | void help(void); 33 | void toggle_led(void); 34 | void execute(void); 35 | void login(void); 36 | void encrypt(void); 37 | void morse_print(uint8_t data); 38 | void morse_flash(uint8_t data); 39 | void aes_setup(void); 40 | 41 | uint8_t usart_recv_byte(void); 42 | uint8_t priv_chk(void); 43 | 44 | 45 | /********************/ 46 | /* Global variables */ 47 | /********************/ 48 | 49 | aes_key_t key; 50 | 51 | /* A complete command was received */ 52 | uint8_t parse_flag; 53 | 54 | /* RX buffer */ 55 | uint8_t inbuffer[INBUFFER_LEN]; 56 | 57 | /* Current position inside INBUFFER_LEN */ 58 | uint8_t pos_inbuffer; 59 | 60 | /* User admin status */ 61 | uint8_t admin; 62 | 63 | /* Morse code table */ 64 | uint8_t mrs_table[16][10] = {"- - - - -", // 0x30 0 65 | ". - - - -", // 0x31 1 66 | ". . - - -", // 0x32 2 67 | ". . . - -", // 0x33 3 68 | ". . . . -", // 0x34 4 69 | ". . . . .", // 0x35 5 70 | "- . . . .", // 0x36 6 71 | "- - . . .", // 0x37 7 72 | "- - - . .", // 0x38 8 73 | "- - - - .", // 0x39 9 74 | ". -\x00*****", // 0x41 A 75 | "- . . .\x00*", // 0x42 B 76 | "- . - .\x00*", // 0x43 C 77 | "- . .\x00***", // 0x44 D 78 | ".\x00*******", // 0x45 E 79 | ". . - .\x00*", // 0x46 F 80 | }; 81 | 82 | /************************/ 83 | /* Function Definitions */ 84 | /************************/ 85 | 86 | int main(void) 87 | { 88 | uint32_t i; 89 | 90 | aes_setup(); 91 | 92 | /* Set the clock to 2MHz to give more chances to properly inject the fault */ 93 | clock_prescale_set(clock_div_8); 94 | 95 | /* Set the LED as output in the Data Direction Register */ 96 | DDRB = 0x20; 97 | 98 | /* Initialize global variables. */ 99 | parse_flag = 0; 100 | pos_inbuffer = 0; 101 | admin = 0; 102 | 103 | serial_init(); 104 | help(); 105 | usart_print("\r\n>> "); 106 | 107 | /* Clean inbuffer so all the encryptions are deterministic */ 108 | for (i = 0; i < INBUFFER_LEN; i++) { 109 | inbuffer[i] = 0; 110 | } 111 | /* Wait for commands */ 112 | while (1) { 113 | if (parse_flag == 1) { 114 | execute(); 115 | usart_print("\r\n>> "); 116 | } 117 | } 118 | free(key); 119 | return (0); 120 | } 121 | /** 122 | * @brief aes_setup Set the key from the flag value 123 | */ 124 | void aes_setup(void) 125 | { 126 | uint8_t aux[32] = {0xa9, 0xea, 0x57, 0xa7, 0xec, 0xfd, 0x4d, 0x2f, 0x55, 0x6c, 0x81, 0x87, 0x99, 0x3d, 0x7b, 0x29}; 127 | int i; 128 | 129 | key = (uint8_t*)malloc(AES_KEY_SIZE); 130 | 131 | for (i = 0; i < AES_KEY_SIZE; i++) { 132 | key[i] = aux[i]; 133 | } 134 | memset(aux, 0, sizeof(aux)); 135 | } 136 | 137 | /** 138 | * @brief Send a single byte. 139 | * @param[in] byte Byte to send 140 | */ 141 | void usart_send_byte(uint8_t byte) { 142 | /* Wait for empty transmit buffer */ 143 | while ( !(UCSR0A & (1 << UDRE0)) ) { 144 | } 145 | 146 | /* Send byte */ 147 | UDR0 = byte; 148 | } 149 | 150 | 151 | /** 152 | * @brief Configure the USART0 port. 153 | */ 154 | void serial_init(void) 155 | { 156 | /* Set baud rate */ 157 | UBRR0H = 0; //(uint8_t)(baud >> 8); 158 | UBRR0L = 12;//(uint8_t) baud; 159 | 160 | UCSR0A |= (1 << U2X0); 161 | /* Enable received and transmitter */ 162 | UCSR0B = (1 << RXEN0) | (1 << TXEN0); 163 | 164 | /* Set frame format (8N1) */ 165 | UCSR0C = (1 << UCSZ00) | (1 << UCSZ01); 166 | UCSR0C &= ~(1 << UMSEL00); 167 | UCSR0B |= (1 << RXCIE0); 168 | sei(); 169 | } 170 | 171 | /** 172 | * @brief Transmit a string. 173 | * @param[in] s Null terminated string to send 174 | */ 175 | void usart_print(char *s) 176 | { 177 | while (*s != 0) { 178 | usart_send_byte( *(s++) ); 179 | 180 | /* Let the VM breathe */ 181 | _delay_ms(1); 182 | } 183 | } 184 | 185 | /** 186 | * @brief Check for incomming data. 187 | * @return 1 If there is data avaliable, 0 otherwise 188 | */ 189 | uint8_t usart_data_available(void) 190 | { 191 | if ( UCSR0A & (1 << RXC0) ) 192 | return 1; 193 | return 0; 194 | } 195 | 196 | /** 197 | * @brief Get incoming data. 198 | * @return Received byte. 199 | */ 200 | uint8_t usart_recv_byte(void) 201 | { 202 | /* Wait until data is available */ 203 | while ( !usart_data_available() ){ 204 | } 205 | 206 | /* Read byte */ 207 | return UDR0; 208 | } 209 | 210 | /** 211 | * @brief Display the help menu. 212 | */ 213 | void help(void) 214 | { 215 | usart_print(" \r\n"); 216 | usart_print("====== Jungle Assistance System V1.0 ======\r\n\r\n"); 217 | usart_print("This board will help you get out of the jungle in no time!\r\n"); 218 | usart_print("Write a message of maximum 16 bytes asking for help, the message\r\n"); 219 | usart_print("will be transmitted _encrypted_ using the LED and a secret key.\r\n"); 220 | usart_print("The key will remain secure even if the JAS falls into enemy\r\n\r"); 221 | usart_print("hands (We hope so).\r\n\r\n"); 222 | usart_print("As the LED is not powerful enough please aim carefuly.\r\n"); 223 | 224 | } 225 | 226 | /** 227 | * @brief UART receive interruption. 228 | * 229 | * Adds the received characters to te inBuffer and signals 230 | * when a LF character is received so the command can be 231 | * parsed. 232 | */ 233 | ISR(USART_RX_vect) 234 | { 235 | uint8_t data; 236 | data = UDR0; 237 | 238 | /* CHR_LF signals end of command */ 239 | if (data == CHR_LF) { 240 | pos_inbuffer = 0; 241 | parse_flag = 1; 242 | 243 | } else if (pos_inbuffer < INBUFFER_LEN) { 244 | inbuffer[pos_inbuffer] = data; 245 | pos_inbuffer++; 246 | } 247 | } 248 | 249 | /** 250 | * @brief Toggle the led. 251 | */ 252 | void toggle_led(void) 253 | { 254 | PORTB ^= (1 << PORTB5); 255 | } 256 | 257 | /** 258 | * @brief execute the received command 259 | */ 260 | void execute(void) 261 | { 262 | encrypt(); 263 | parse_flag = 0; 264 | } 265 | 266 | /** 267 | * @brief Encrypt the message. 268 | */ 269 | void encrypt(void) 270 | { 271 | aes_state_t data = (aes_state_t) inbuffer; 272 | uint32_t i; 273 | 274 | aes_key_expansion(key); 275 | aes_ecb_encrypt(data, key); 276 | 277 | /* Print morse representation on the screen. */ 278 | // for (i = 0; i < 16; i++) { 279 | // morse_print(data[i]); 280 | // } 281 | cli(); 282 | for (i = 0; i < 16; i++) { 283 | morse_flash(data[i]); 284 | } 285 | sei(); 286 | /* If this is enabled, the data can be corrupted everywhere 287 | * and it becomes TOO dificult to check if the fault is too 288 | * late. 289 | */ 290 | // for (i = 0; i < 16; i++) { 291 | // data[i] = 0; 292 | // } 293 | } 294 | 295 | /** 296 | * @brief morse_print Send the ascii dash-dot representation on the UART 297 | * @param data Data do send in binary 298 | * 299 | * If data is 0xFA, then the morse code for F is send, and then the 300 | * morse code for A. 301 | */ 302 | void morse_print(uint8_t data) 303 | { 304 | usart_print( (char *) mrs_table[ (data >> 4) & 0x0F ] ); 305 | usart_print(" "); 306 | usart_print( (char *) mrs_table[ data & 0x0F ]); 307 | usart_print(" "); 308 | } 309 | 310 | /** 311 | * @brief morse_flash Flashes the led with a morse pattern. 312 | * @param data Data to send in binary 313 | */ 314 | void morse_flash(uint8_t data) 315 | { 316 | uint8_t* morse_str; 317 | uint8_t signal; 318 | uint32_t e; 319 | const uint32_t dot_time = 100; 320 | 321 | /* Send the most significant nibble */ 322 | morse_str = mrs_table[ (data >> 4) & 0x0F ]; 323 | while (*morse_str) { 324 | signal = *morse_str; 325 | switch (signal) { 326 | case '-': 327 | PORTB ^= (1 << PORTB5); 328 | for (e=dot_time * 3; e>0; e--); 329 | PORTB ^= (1 << PORTB5); 330 | break; 331 | 332 | case '.': 333 | PORTB ^= (1 << PORTB5); 334 | for (e=dot_time; e>0; e--); 335 | PORTB ^= (1 << PORTB5); 336 | break; 337 | 338 | } 339 | for (e=dot_time; e>0; e--); 340 | morse_str++; 341 | } 342 | /* At the end of the letter a silence of 3 dots is expected 3 */ 343 | for (e = dot_time *4; e > 0; e--); 344 | 345 | /* Send the second nibble */ 346 | morse_str = mrs_table[ data & 0x0F ]; 347 | 348 | while (*morse_str) { 349 | signal = *morse_str; 350 | switch (signal) { 351 | case '-': 352 | PORTB ^= (1 << PORTB5); 353 | for (e=dot_time * 3; e>0; e--); 354 | PORTB ^= (1 << PORTB5); 355 | break; 356 | 357 | case '.': 358 | PORTB ^= (1 << PORTB5); 359 | for (e=dot_time; e>0; e--); 360 | PORTB ^= (1 << PORTB5); 361 | break; 362 | 363 | } 364 | for (e = dot_time; e > 0; e--); 365 | morse_str++; 366 | } 367 | /* At the end of the letter a silence of 3 dots is expected 3 */ 368 | for (e = dot_time * 4; e > 0; e--); 369 | 370 | } 371 | -------------------------------------------------------------------------------- /challenges/binaries/fiasco/fiasco.hex: -------------------------------------------------------------------------------- 1 | :100000000C9434000C9451000C9451000C94510049 2 | :100010000C9451000C9451000C9451000C9451001C 3 | :100020000C9451000C9451000C9451000C9451000C 4 | :100030000C9451000C9451000C9451000C945100FC 5 | :100040000C9451000C9451000C9451000C945100EC 6 | :100050000C9451000C9451000C9451000C945100DC 7 | :100060000C9451000C94510011241FBECFEFD8E026 8 | :10007000DEBFCDBF11E0A0E0B1E0E0EBFCE002C0EC 9 | :1000800005900D92A838B107D9F722E0A8E8B1E0B1 10 | :1000900001C01D92A232B207E1F70E9489010C94BF 11 | :1000A00056060C940000CF93DF9300D0CDB7DEB797 12 | :1000B000CE0109969A83898329813A818F81988517 13 | :1000C000AC0168E770E089E891E00E94FC0289E8F1 14 | :1000D00091E00E94AF000F900F90DF91CF910895B3 15 | :1000E000CF93DF9300D0CDB7DEB783E390E09A8360 16 | :1000F000898385EC90E029813A81232F3327FC0105 17 | :10010000208384EC90E02981FC01208381EC90E045 18 | :1001100028E1FC01208382EC90E026E0FC012083B2 19 | :100120000F900F90DF91CF910895CF93DF931F929F 20 | :10013000CDB7DEB78983000080EC90E0FC018081C0 21 | :10014000882F90E080729927892BB1F386EC90E09C 22 | :100150002981FC0120830F90DF91CF910895CF93E7 23 | :10016000DF9300D0CDB7DEB79A8389830BC0898136 24 | :100170009A819C012F5F3F4F3A832983FC01808144 25 | :100180000E94950089819A81FC018081882379F7FA 26 | :100190000F900F90DF91CF910895CF93DF93CDB75C 27 | :1001A000DEB780EC90E0FC018081882314F481E0CC 28 | :1001B00001C080E0DF91CF910895CF93DF93CDB759 29 | :1001C000DEB700000E94CD008823E1F386EC90E0CA 30 | :1001D000FC018081DF91CF910895CF93DF93CDB75C 31 | :1001E000DEB780918801882349F480E090E00E9486 32 | :1001F000A6050E94EA0281E080938801DF91CF91F9 33 | :1002000008950F931F93CF93DF931F92CDB7DEB75F 34 | :100210000E94ED0019820EC08981082F10E00E9413 35 | :10022000E502282FC8018F5F9D4FFC012083898143 36 | :100230008F5F89838981803178F30F90DF91CF912F 37 | :100240001F910F910895CF93DF9300D0CDB7DEB704 38 | :1002500040E150E060E070E081E192E00E94F50250 39 | :10026000198216C00E94DD008A838A818D3009F4CC 40 | :100270000CC08A818A3009F40EC08981882F90E0F1 41 | :100280008F5E9D4F2A81FC01208389818F5F898346 42 | :100290008981803138F30F900F90DF91CF910895CD 43 | :1002A000CF93DF93CDB7DEB727970FB6F894DEBFB5 44 | :1002B0000FBECDBF9C838B837E836D834F831A8259 45 | :1002C000198219C08B819C81FC0120818D819E81C6 46 | :1002D000FC01808182279A81892B8A838B819C8172 47 | :1002E00001969C838B838D819E8101969E838D8355 48 | :1002F00089818F5F898399818F81981718F38A810B 49 | :1003000027960FB6F894DEBF0FBECDBFDF91CF9119 50 | :100310000895CF93DF9300D0CDB7DEB719820E9446 51 | :1003200070000E94010100000000000000000000B9 52 | :1003300000000000000000000000000000000000BD 53 | :1003400000000000000000000000000000000000AD 54 | :10035000000000000000000000000000000000009D 55 | :10036000000000000000000000000000000000008D 56 | :10037000000000000000000000000000000000007D 57 | :10038000000000000000000000000E94010184E065 58 | :1003900091E0892F8F9384E091E08F930E94530026 59 | :1003A0000F900F9084E18A8319828AE191E0892F6E 60 | :1003B0008F938AE191E08F930E9453000F900F90EA 61 | :1003C0000E94230140E161E072E081E192E00E943D 62 | :1003D0005001882311F081E089838981882311F3FA 63 | :1003E000000000000000000000000000000000000D 64 | :1003F00000000000000000000000000000000000FD 65 | :1004000000000000000000000000000000000000EC 66 | :1004100000000000000000000000000000000000DC 67 | :1004200000000000000000000000000000000000CC 68 | :1004300000000000000000000000000000000000BC 69 | :10044000000000008A81880F8D5F8A830000000011 70 | :10045000000000000000000000000000000000009C 71 | :10046000000000000000000000000000000000008C 72 | :10047000000000000000000000000000000000007C 73 | :10048000000000000000000000000000000000006C 74 | :10049000000000000000000000000000000000005C 75 | :1004A000000000000000000000000000000000004C 76 | :1004B00040E161E072E081E192E00E945001882316 77 | :1004C00061F084E491E0892F8F9384E491E08F932D 78 | :1004D0000E9453000F900F9065CF89E591E0892F1E 79 | :1004E0008F9389E591E08F930E9453000F900F90B6 80 | :1004F00089E691E0892F8F9389E691E08F930E949E 81 | :1005000053000F900F908A818B3261F084E491E068 82 | :10051000892F8F9384E491E08F930E9453000F9072 83 | :100520000F9040CF80E090E00F900F90DF91CF913F 84 | :1005300008958F929F92AF92BF92CF92DF92EF92E7 85 | :10054000FF92CF93DF93EC01688179818A819B814F 86 | :10055000611571058105910521F464E279ED8BE562 87 | :1005600097E02DE133EF41E050E00E94BC054901E6 88 | :100570005A019B01AC01A7EAB1E40E94DB056B01C3 89 | :100580007C01ACEEB4EFA50194010E94E905DC0109 90 | :10059000CB018C0D9D1DAE1DBF1DB7FF03C0019784 91 | :1005A000A109B04888839983AA83BB839F77DF9191 92 | :1005B000CF91FF90EF90DF90CF90BF90AF909F9042 93 | :1005C0008F9008950E949902089580E091E00E9422 94 | :1005D00099020895A0E0B0E080930001909301019A 95 | :1005E000A0930201B09303010895DC0101C06D9353 96 | :1005F00041505040E0F70895AEE0B0E0E2E0F3E0B3 97 | :100600000C94FC058C01CA0146E04C831A830983D3 98 | :1006100077FF02C060E070E8FB013197FE83ED8355 99 | :10062000A901BC01CE0101960E9428034D815E8183 100 | :1006300057FD0AC02F813885421753070CF49A01E1 101 | :10064000F801E20FF31F10822E96E4E00C941806D6 102 | :10065000ACE0B0E0EEE2F3E00C94EE057C016B015F 103 | :100660008A01FC0117821682838181FFBDC1CE0100 104 | :1006700001964C01F7019381F60193FD859193FF5B 105 | :1006800081916F01882309F4ABC1853239F493FD60 106 | :10069000859193FF81916F01853229F4B70190E034 107 | :1006A0000E941005E7CF512C312C20E02032A0F41D 108 | :1006B0008B3269F030F4803259F0833269F4206172 109 | :1006C0002CC08D3239F0803339F4216026C022608D 110 | :1006D000246023C0286021C027FD27C030ED380FDB 111 | :1006E0003A3078F426FF06C0FAE05F9E300D112400 112 | :1006F000532E13C08AE0389E300D1124332E206211 113 | :100700000CC08E3221F426FD6BC1206406C08C36ED 114 | :1007100011F4206802C0883641F4F60193FD8591FA 115 | :1007200093FF81916F018111C1CF982F9F7D9554C7 116 | :10073000933028F40C5F1F4FFFE3F9830DC083361D 117 | :1007400031F0833771F0833509F05BC022C0F801C6 118 | :10075000808189830E5F1F4F44244394512C5401A0 119 | :1007600015C03801F2E06F0E711CF801A080B18055 120 | :1007700026FF03C0652D70E002C06FEF7FEFC5015B 121 | :100780002C870E9405052C0183012C852F77222EB2 122 | :1007900017C03801F2E06F0E711CF801A080B18023 123 | :1007A00026FF03C0652D70E002C06FEF7FEFC5012B 124 | :1007B0002C870E94FA042C012C852068222E8301AC 125 | :1007C00023FC1BC0832D90E048165906B0F4B701F6 126 | :1007D00080E290E00E9410053A94F4CFF50127FCE6 127 | :1007E000859127FE81915F01B70190E00E9410057D 128 | :1007F00031103A94F1E04F1A51084114510471F745 129 | :10080000E5C0843611F0893639F5F80127FF07C0B5 130 | :1008100060817181828193810C5F1F4F08C060816C 131 | :100820007181072E000C880B990B0E5F1F4F2F76DE 132 | :10083000722E97FF09C090958095709561957F4FB6 133 | :100840008F4F9F4F2068722E2AE030E0A4010E9453 134 | :100850004805A82EA81844C0853729F42F7EB22E4B 135 | :100860002AE030E025C0F22FF97FBF2E8F36C1F08D 136 | :1008700018F4883579F0B4C0803719F0883721F042 137 | :10088000AFC02F2F2061B22EB4FE0DC08B2D84601F 138 | :10089000B82E09C024FF0AC09F2F9660B92E06C04B 139 | :1008A00028E030E005C020E130E002C020E132E085 140 | :1008B000F801B7FE07C060817181828193810C5F6E 141 | :1008C0001F4F06C06081718180E090E00E5F1F4F76 142 | :1008D000A4010E944805A82EA818FB2DFF777F2EA3 143 | :1008E00076FE0BC0372D3E7FA51450F474FE0AC06F 144 | :1008F00072FC08C0372D3E7E05C0BA2C372D03C0D0 145 | :10090000BA2C01C0B52C34FF0DC0FE01EA0DF11D5B 146 | :100910008081803311F4397E09C032FF06C0B39460 147 | :10092000B39404C0832F867809F0B39433FD13C0C9 148 | :1009300030FF06C05A2CB31418F4530C5B18B32CB8 149 | :10094000B31468F4B70180E290E03C870E94100580 150 | :10095000B3943C85F5CFB31410F43B1801C0312C8F 151 | :1009600034FF12C0B70180E390E03C870E9410057D 152 | :100970003C8532FF17C031FD03C088E790E002C01C 153 | :1009800088E590E0B7010CC0832F867859F031FFDD 154 | :1009900002C08BE201C080E237FD8DE2B70190E03A 155 | :1009A0000E941005A51438F4B70180E390E00E947E 156 | :1009B00010055A94F7CFAA94F401EA0DF11D808135 157 | :1009C000B70190E00E941005A110F5CF332009F483 158 | :1009D00051CEB70180E290E00E9410053A94F6CF24 159 | :1009E000F7018681978102C08FEF9FEF2C96E2E19D 160 | :1009F0000C940A06FC010590615070400110D8F774 161 | :100A0000809590958E0F9F1F0895FC016150704056 162 | :100A100001900110D8F7809590958E0F9F1F089533 163 | :100A20000F931F93CF93DF93FB01238121FD03C01D 164 | :100A30008FEF9FEF28C022FF16C046815781248187 165 | :100A400035814217530744F4A081B1819D012F5F86 166 | :100A50003F4F318320838C93268137812F5F3F4F17 167 | :100A60003783268310C0EB01092F182F0084F185EE 168 | :100A7000E02D0995892BE1F68E819F8101969F8358 169 | :100A80008E83812F902FDF91CF911F910F91089529 170 | :100A9000FA01AA27283051F1203181F1E8946F93AF 171 | :100AA0006E7F6E5F7F4F8F4F9F4FAF4FB1E03ED055 172 | :100AB000B4E03CD0670F781F891F9A1FA11D680FF3 173 | :100AC000791F8A1F911DA11D6A0F711D811D911D26 174 | :100AD000A11D20D009F468943F912AE0269F11249B 175 | :100AE0003019305D3193DEF6CF010895462F4770FF 176 | :100AF000405D4193B3E00FD0C9F7F6CF462F4F705A 177 | :100B0000405D4A3318F0495D31FD4052419302D0B7 178 | :100B1000A9F7EACFB4E0A69597958795779567955D 179 | :100B2000BA95C9F700976105710508959B01AC015D 180 | :100B30000A2E06945795479537952795BA95C9F784 181 | :100B4000620F731F841F951FA01D0895A8E1B0E0D8 182 | :100B500042E050E00C94AE05DC01CB01FC01F999B8 183 | :100B6000FECF06C0F2BDE1BDF89A319600B40D92F9 184 | :100B700041505040B8F70895052E97FB1EF400949D 185 | :100B80000E94D30557FD07D00E94250607FC03D01D 186 | :100B90004EF40C94D30550954095309521953F4FD8 187 | :100BA0004F4F5F4F089590958095709561957F4F59 188 | :100BB0008F4F9F4F08950E944706A59F900DB49FA9 189 | :100BC000900DA49F800D911D11240895B7FF0C94E2 190 | :100BD000DB050E94DB05821B930B08952F923F9249 191 | :100BE0004F925F926F927F928F929F92AF92BF923D 192 | :100BF000CF92DF92EF92FF920F931F93CF93DF93E9 193 | :100C0000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBE45 194 | :100C1000CDBF09942A88398848885F846E847D8492 195 | :100C20008C849B84AA84B984C884DF80EE80FD8094 196 | :100C30000C811B81AA81B981CE0FD11D0FB6F8940A 197 | :100C4000DEBF0FBECDBFED010895A1E21A2EAA1B93 198 | :100C5000BB1BFD010DC0AA1FBB1FEE1FFF1FA2176C 199 | :100C6000B307E407F50720F0A21BB30BE40BF50B69 200 | :100C7000661F771F881F991F1A9469F760957095F2 201 | :100C8000809590959B01AC01BD01CF010895A29F75 202 | :100C9000B001B39FC001A39F700D811D1124911D50 203 | :100CA000B29F700D811D1124911D0895F894FFCFFE 204 | :100CB0000100000052484D4532204649206C6576BF 205 | :100CC000656C20332E0D0A0D0A0043686970206C94 206 | :100CD0006F636B65640D0A506C6561736520777294 207 | :100CE00069746520796F75722070617373776F72A4 208 | :100CF000643A2000476F6F64207472792C20636817 209 | :100D00006561746572210D0A004368697020756E13 210 | :100D10006C6F636B65640D0A00596F757220666CA9 211 | :100D200061672069733A207930555F6D347374655B 212 | :080D30007233645F46492100A3 213 | :00000001FF 214 | -------------------------------------------------------------------------------- /challenges/binaries/jumpy/jumpy.hex: -------------------------------------------------------------------------------- 1 | :100000000C9434000C9451000C9451000C94510049 2 | :100010000C9451000C9451000C9451000C9451001C 3 | :100020000C9451000C9451000C9451000C9451000C 4 | :100030000C9451000C9451000C9451000C945100FC 5 | :100040000C9451000C9451000C9451000C945100EC 6 | :100050000C9451000C9451000C9451000C945100DC 7 | :100060000C9451000C94510011241FBECFEFD8E026 8 | :10007000DEBFCDBF11E0A0E0B1E0ECE0FDE002C0EA 9 | :1000800005900D92AE33B107D9F723E0AEE3B1E0AE 10 | :1000900001C01D92A235B207E1F70E94D1030C9472 11 | :1000A00084060C940000CF93DF931F92CDB7DEB788 12 | :1000B0008983000080EC90E0FC018081882F90E033 13 | :1000C00080729927892BB1F386EC90E02981FC019D 14 | :1000D00020830F90DF91CF910895CF93DF93CDB719 15 | :1000E000DEB785EC90E0FC01108284EC90E023E325 16 | :1000F000FC01208381EC90E028E1FC01208382EC6C 17 | :1001000090E026E0FC01208382EC90E022EC30E0DD 18 | :10011000F90120812F7BFC01208381EC90E021EC10 19 | :1001200030E0F90120812068FC012083DF91CF912C 20 | :100130000895CF93DF93CDB7DEB760970FB6F894ED 21 | :10014000DEBF0FBECDBF988B8F877DC08F8598890E 22 | :100150009C012F5F3F4F388B2F87FC0180810E94CD 23 | :10016000530080E090E0A0E8BFE389839A83AB83EB 24 | :10017000BC8320E030E04AE755E469817A818B81D5 25 | :100180009C810E94E805DC01CB018D839E83AF83B7 26 | :10019000B88720E030E040E85FE36D817E818F81A9 27 | :1001A00098850E94620588232CF481E090E09A876C 28 | :1001B00089873FC020E03FEF4FE757E46D817E81A4 29 | :1001C0008F8198850E94E30518164CF520E030E0F9 30 | :1001D00040E251E469817A818B819C810E94E8052B 31 | :1001E000DC01CB01BC01CD010E946705DC01CB0124 32 | :1001F0009A8789870FC080E991E09C878B878B85E0 33 | :100200009C850197F1F79C878B8789859A85019753 34 | :100210009A87898789859A85892B69F714C06D81AA 35 | :100220007E818F8198850E946705DC01CB019A87CA 36 | :10023000898789859A859E878D878D859E8501977B 37 | :10024000F1F79E878D878F859889FC0180818823AF 38 | :1002500009F07CCF60960FB6F894DEBF0FBECDBF1D 39 | :10026000DF91CF910895CF93DF93CDB7DEB780ECC8 40 | :1002700090E0FC018081882314F481E001C080E0DB 41 | :10028000DF91CF910895CF93DF93CDB7DEB7000014 42 | :100290000E9433018823E1F386EC90E0FC01808129 43 | :1002A000DF91CF910895CF93DF9300D01F92CDB708 44 | :1002B000DEB71A82198215C00E9443018B838B819D 45 | :1002C0008A3099F08B818D3081F089819A81825CAE 46 | :1002D0009E4F2B81FC01208389819A8101969A830C 47 | :1002E000898389819A810F9738F389819A81825C09 48 | :1002F0009E4FFC0110820F900F900F90DF91CF91D5 49 | :100300000895CF93DF931F92CDB7DEB7198219827C 50 | :1003100003C089818F5F89838981882F90E0825C07 51 | :100320009E4FFC0180818823A1F789818D3051F493 52 | :1003300080914E0190914F01816090934F01809385 53 | :100340004E0104C010924F0110924E010F90DF91A8 54 | :10035000CF910895CF93DF93CDB7DEB7809145015C 55 | :10036000282F30E080914601882F90E0820F931F64 56 | :10037000833D910551F480914E0190914F01916020 57 | :1003800090934F0180934E0104C010924F01109240 58 | :100390004E01DF91CF910895CF93DF931F92CDB798 59 | :1003A000DEB7198203C089818F5F89838981882F95 60 | :1003B00090E0825C9E4FFC0180818823A1F78091B0 61 | :1003C0004A01482F50E08981282F30E0429FC00128 62 | :1003D000439F900D529F900D11248739924051F404 63 | :1003E00080914E0190914F01906290934F018093C4 64 | :1003F0004E0104C010924F0110924E010F90DF91F8 65 | :10040000CF910895CF93DF93CDB7DEB780914701A9 66 | :10041000282F30E080914801882F90E0820F931FB1 67 | :100420008F38910551F480914E0190914F01946065 68 | :1004300090934F0180934E0104C010924F0110928F 69 | :100440004E01DF91CF910895CF93DF93CDB7DEB703 70 | :1004500080914201482F50E080914301282F30E0E5 71 | :10046000429FC001439F900D529F900D11248F32E7 72 | :10047000924151F480914E0190914F01806290938E 73 | :100480004F0180934E0104C010924F0110924E0113 74 | :10049000DF91CF910895CF93DF93CDB7DEB78091F1 75 | :1004A0004101282F30E080914201882F90E0820F97 76 | :1004B000931F8239910551F480914E0190914F0123 77 | :1004C000806190934F0180934E0104C010924F01C0 78 | :1004D00010924E01DF91CF910895CF93DF93CDB766 79 | :1004E000DEB780914801482F50E080914901282FC4 80 | :1004F00030E0429FC001439F900D529F900D112408 81 | :100500008337984251F480914E0190914F01986049 82 | :1005100090934F0180934E0104C010924F011092AE 83 | :100520004E01DF91CF910895CF93DF93CDB7DEB722 84 | :1005300080914401482F50E080914501282F30E000 85 | :10054000429FC001439F900D529F900D11248C300B 86 | :100550009B4251F480914E0190914F01806890939D 87 | :100560004F0180934E0104C010924F0110924E0132 88 | :10057000DF91CF910895CF93DF93CDB7DEB7809110 89 | :100580003F01282F30E080914001882F90E0820FBA 90 | :10059000931F873A910551F480914E0190914F013C 91 | :1005A000846090934F0180934E0104C010924F01DC 92 | :1005B00010924E01DF91CF910895CF93DF93CDB785 93 | :1005C000DEB780914901282F30E080914A01882FC1 94 | :1005D00090E0820F931F803A910551F480914E0173 95 | :1005E00090914F01906190934F0180934E0104C010 96 | :1005F00010924F0110924E01DF91CF910895CF9349 97 | :10060000DF93CDB7DEB780913E01482F50E0809157 98 | :100610003F01282F30E0429FC001439F900D529F21 99 | :10062000900D1124873B934151F480914E0190919C 100 | :100630004F01826090934F0180934E0104C010924D 101 | :100640004F0110924E01DF91CF910895CF93DF9328 102 | :10065000CDB7DEB780914001482F50E08091410135 103 | :10066000282F30E0429FC001439F900D529F900D74 104 | :1006700011248238974151F480914E0190914F019D 105 | :10068000886090934F0180934E0104C010924F01F7 106 | :1006900010924E01DF91CF910895CF93DF93CDB7A4 107 | :1006A000DEB780914601482F50E080914701282F06 108 | :1006B00030E0429FC001439F900D529F900D112446 109 | :1006C000803C954151F480914E0190914F01926090 110 | :1006D00090934F0180934E0104C010924F011092ED 111 | :1006E0004E01DF91CF910895CF93DF93CDB7DEB761 112 | :1006F00080914301282F30E080914401882F90E0C1 113 | :10070000820F931F853A910551F480914E0190918B 114 | :100710004F01806490934F0180934E0104C010926A 115 | :100720004F0110924E01DF91CF910895CF93DF9347 116 | :10073000CDB7DEB780914E0190914F018F3F9F431F 117 | :1007400049F480E091E00E94990088E191E00E94E4 118 | :10075000990004C08BE191E00E949900DF91CF9154 119 | :100760000895CF93DF93CDB7DEB786E391E00E9483 120 | :100770009900DF91CF910895CF93DF93CDB7DEB786 121 | :10078000FFCFCF93DF93CDB7DEB78091500190912B 122 | :10079000510101969093510180935001DF91CF91C7 123 | :1007A0000895CF93DF9300D000D0CDB7DEB788EDAA 124 | :1007B00090E09C838B8340E052E061E470E082E54E 125 | :1007C00091E00E947D060E946D0010924F011092F0 126 | :1007D0004E018B819C819C012F5F3F4F3C832B837B 127 | :1007E00021EC33E0322723273227880F991F8E5AB6 128 | :1007F0009E4FFC01318320838B819C819C012F5F64 129 | :100800003F4F3C832B8321EB33E0322723273227D2 130 | :10081000880F991F8E5A9E4FFC01318320838B8154 131 | :100820009C819C012F5F3F4F3C832B8323E531E06C 132 | :10083000322723273227880F991F8E5A9E4FFC019B 133 | :10084000318320838B819C819C012F5F3F4F3C83B0 134 | :100850002B8321E831E0322723273227880F991F85 135 | :100860008E5A9E4FFC01318320838B819C819C0199 136 | :100870002F5F3F4F3C832B832AEA31E03227232727 137 | :100880003227880F991F8E5A9E4FFC013183208397 138 | :100890008B819C819C012F5F3F4F3C832B832DE4F8 139 | :1008A00033E0322723273227880F991F8E5A9E4F15 140 | :1008B000FC01318320838B819C819C012F5F3F4F02 141 | :1008C0003C832B832FEF32E0322723273227880FF8 142 | :1008D000991F8E5A9E4FFC01318320838B819C810E 143 | :1008E0009C012F5F3F4F3C832B8326E233E032276E 144 | :1008F00023273227880F991F8E5A9E4FFC01318380 145 | :1009000020838B819C819C012F5F3F4F3C832B83F5 146 | :100910002BE432E0322723273227880F991F8E5A83 147 | :100920009E4FFC01318320838B819C819C012F5F32 148 | :100930003F4F3C832B8324E932E0322723273227A1 149 | :10094000880F991F8E5A9E4FFC01318320838B8123 150 | :100950009C819C012F5F3F4F3C832B8324E733E036 151 | :10096000322723273227880F991F8E5A9E4FFC016A 152 | :10097000318320838B819C819C012F5F3F4F3C837F 153 | :100980002B8322E032E0322723273227880F991F5A 154 | :100990008E5A9E4FFC01318320838B819C819C0168 155 | :1009A0002F5F3F4F3C832B832BEB32E032272327F3 156 | :1009B0003227880F991F8E5A9E4FFC013183208366 157 | :1009C0008B819C819C012F5F3F4F3C832B832DE6C5 158 | :1009D00032E0322723273227880F991F8E5A9E4FE5 159 | :1009E000FC01318320838B819C819C012F5F3F4FD1 160 | :1009F0003C832B832CEC31E0322723273227880FCE 161 | :100A0000991F8E5A9E4FFC01318320838B819C81DC 162 | :100A10009C012F5F3F4F3C832B8324E232E032273F 163 | :100A200023273227880F991F8E5A9E4FFC0131834E 164 | :100A300020838B819C819C012F5F3F4F3C832B83C4 165 | :100A40002DED32E0322723273227880F991F8E5A47 166 | :100A50009E4FFC01318320838B819C819C012F5F01 167 | :100A60003F4F3C832B8326E933E03227232732276D 168 | :100A7000880F991F8E5A9E4FFC01318320838B81F2 169 | :100A80009C819C012F5F3F4F3C832B832CEB33E0F9 170 | :100A9000322723273227880F991F8E5A9E4FFC0139 171 | :100AA0003183208381E093E09A8389838DBF9EBF49 172 | :100AB000089580E090E00F900F900F900F90DF91DD 173 | :100AC000CF9108950E94960508F481E008950E9450 174 | :100AD000C20588F09F5798F0B92F9927B751B0F009 175 | :100AE000E1F0660F771F881F991F1AF0BA95C9F7B2 176 | :100AF00014C0B13091F00E94DC05B1E008950C946F 177 | :100B0000DC05672F782F8827B85F39F0B93FCCF321 178 | :100B1000869577956795B395D9F73EF4909580952E 179 | :100B2000709561957F4F8F4F9F4F0895990F0008E3 180 | :100B3000550FAA0BE0E8FEEF16161706E807F907AF 181 | :100B4000C0F012161306E407F50798F0621B730B4A 182 | :100B5000840B950B39F40A2661F0232B242B252BCB 183 | :100B600021F408950A2609F4A140A6958FEF811D6E 184 | :100B7000811D089557FD9058440F551F59F05F3F50 185 | :100B800071F04795880F97FB991F61F09F3F79F0AF 186 | :100B900087950895121613061406551FF2CF469531 187 | :100BA000F1DF08C0161617061806991FF1CF8695B3 188 | :100BB0007105610508940895E894BB276627772797 189 | :100BC000CB0197F908950E94960508F48FEF0895D8 190 | :100BD0000E94FB050C946C060E945E0638F00E9491 191 | :100BE000650620F0952311F00C9455060C945B06D5 192 | :100BF00011240C94DD050E94BA0570F3959FC1F392 193 | :100C0000950F50E0551F629FF001729FBB27F00DBA 194 | :100C1000B11D639FAA27F00DB11DAA1F649F66270F 195 | :100C2000B00DA11D661F829F2227B00DA11D621F5E 196 | :100C3000739FB00DA11D621F839FA00D611D221F18 197 | :100C4000749F3327A00D611D231F849F600D211DFC 198 | :100C5000822F762F6A2F11249F5750409AF0F1F07F 199 | :100C600088234AF0EE0FFF1FBB1F661F771F881FE8 200 | :100C700091505040A9F79E3F510580F00C945506C5 201 | :100C80000C94DD055F3FE4F3983ED4F386957795A9 202 | :100C90006795B795F795E7959F5FC1F7FE2B880F8E 203 | :100CA000911D9695879597F9089597F99F6780E824 204 | :100CB00070E060E008959FEF80EC089500240A94AE 205 | :100CC0001616170618060906089500240A94121627 206 | :100CD0001306140605060895092E0394000C11F45A 207 | :100CE000882352F0BB0F40F4BF2B11F460FF04C007 208 | :100CF0006F5F7F4F8F4F9F4F0895DC0101C06D9351 209 | :0C0D000041505040E0F70895F894FFCFF8 210 | :100D0C000D0A464C41473A44305F796F755F337634 211 | :100D1C00656E5F524F503F000D0A000D0A4265741C 212 | :100D2C00746572206C75636B206E657874207469C1 213 | :0E0D3C006D65210D0A00496E7075743A200035 214 | :00000001FF 215 | -------------------------------------------------------------------------------- /challenges/binaries/key_server/key_server.hex: -------------------------------------------------------------------------------- 1 | :100000000C94DB030C94F8030C94F8030C94F803A1 2 | :100010000C94F8030C94F8030C94F8030C94F80374 3 | :100020000C94F8030C94F8030C94F8030C94F80364 4 | :100030000C94F8030C94F8030C94F8030C94F80354 5 | :100040000C94F8030C94F8030C94F8030C94F80344 6 | :100050000C94F8030C94F8030C94F8030C94F80334 7 | :100060000C94F8030C94F803333630663938366351 8 | :1000700063326462376237663264393433316539EA 9 | :10008000333234323830313039616331656434337E 10 | :100090003930306135373533316565323837386559 11 | :1000A0003839356336663562346261343331313024 12 | :1000B0003531343133640D0A003035353333356131 13 | :1000C0006237346631653932653431313631356203 14 | :1000D000353236336435313137646166373135371F 15 | :1000E000343066383236613666386661626132367F 16 | :1000F00032306464646132383532613335393561A8 17 | :1001000061396630353164336530623436373636BE 18 | :100110003434300D0A00303062646230386164314A 19 | :100120006439373632386230643465396264636406 20 | :1001300062303330333030376536366239643832C6 21 | :10014000623363613365376466343736393131661B 22 | :100150003164306666643831663637343837623435 23 | :10016000666166633465323532623330633530310F 24 | :100170000D0A0032626637623134303638646633D5 25 | :100180003362653337366231323532376231633745 26 | :1001900066623339306639356430663837386562BF 27 | :1001A00062386133386336323165623431356138F3 28 | :1001B0003562663432623963626361636363373424 29 | :1001C000390D0A0064333363636534653631343680 30 | :1001D0006665333235646535643964306463343858 31 | :1001E00030646264343230316333383539643164B9 32 | :1001F0006562626639353261316533613130633051 33 | :100200006366656236343133663734303734386389 34 | :1002100037613433613334366438393563310D0A2C 35 | :1002200000303063656332373437323462303462E1 36 | :100230006461393664353131363261626637313066 37 | :1002400066626631656564623937386161383736B0 38 | :100250003339653631613136366237373263663469 39 | :100260006264666338666464646233623730306245 40 | :1002700033363664363837363761350D0A00376520 41 | :100280003162316463376461666233666165366525 42 | :10029000333163323537316338396630366163382C 43 | :1002A00035346361633938643130653130366563C4 44 | :1002B00038396162643464303933663238653133D9 45 | :1002C0006462353465613837393862330D0A00634A 46 | :1002D000376434353562653764303530666165635F 47 | :1002E0006133666439383437666234336462616618 48 | :1002F000326130393031333737386532333862372D 49 | :1003000061373934333032373163313035636239F4 50 | :100310003539663366663464306537326137353671 51 | :100320006563633934386263320D0A0030306237F6 52 | :100330003838326163316630333963653563396328 53 | :10034000656637613636383030643232343763347C 54 | :1003500036356364356263626161383063633438B3 55 | :10036000626133346563323735393238306136365D 56 | :10037000363433326637386635336432323261337D 57 | :100380003038656132640D0A003039363763646392 58 | :1003900037366237626261306362373861313538CF 59 | :1003A0003538626363343030363365353363333424 60 | :1003B0006262343763663633626132656238616621 61 | :1003C000336434393131333166326161393633382F 62 | :1003D000383830323637370D0A003963666664665E 63 | :1003E00036663063646431363866343735393464A0 64 | :1003F00032666430363732373837373136616535F3 65 | :100400003139626637386466316362393663303950 66 | :10041000363837383565376630656337646531306F 67 | :1004200030383634346233636333326337343734CD 68 | :10043000386630640D0A003030623761323433344C 69 | :100440003637336535343666663464373937353197 70 | :10045000363661353232386531396161356234336F 71 | :10046000616237396531343766323736393561651F 72 | :1004700065656231393762623331353265663164C0 73 | :100480006630623831393061373330346234646217 74 | :10049000340D0A003732663630653766626436627C 75 | :1004A00062323230653665353665343636646363BC 76 | :1004B0003331343461626237383338383836356531 77 | :1004C0006535633962626138373965613936633061 78 | :1004D00061323532326264623633333833663335F3 79 | :1004E00039310D0A00626131656439363566373459 80 | :1004F000333233383436373331306339376432325C 81 | :10050000393138633435343964396334323636340A 82 | :1005100031343639613537656437353535373336FB 83 | :100520003761643337643363373334383561356466 84 | :100530003734386262636561323131383937660D7C 85 | :100540000A0030306138653466653864646361314F 86 | :100550006134623863393733373664393065343360 87 | :100560006537386639646638323234313232313583 88 | :1005700035313166613365666333663936623334EB 89 | :100580006336626463323039306462626663653256 90 | :100590006531313866663831363863360D0A0037D2 91 | :1005A000346362616330643065346630383330629E 92 | :1005B0006363353166653436383065663164386179 93 | :1005C000666365383964363165663761316665382A 94 | :1005D00066303364643236613730343933303366F1 95 | :1005E000316362666139346231303332330D0A006F 96 | :1005F0003430316639343437346464626635663594 97 | :1006000034623735646661613762656633373063FB 98 | :10061000633938343261393230666639343834639C 99 | :1006200061626163656365343465376332633830B2 100 | :100630006332633937373735613339643033356383 101 | :10064000353934373564623933330D0A003030645C 102 | :100650006238376534613437373463346334363065 103 | :1006600036666161646562353834363064366336C7 104 | :1006700032323832616365643131356165396432F3 105 | :10068000353664366361326433326234393631353B 106 | :100690006339323537383639616130623137353751 107 | :1006A000623866616161650D0A0038613235343443 108 | :1006B00063623036376636373763383765383233FA 109 | :1006C00036326533623363653935306430373263CF 110 | :1006D0003562316261666664363530613331646239 111 | :1006E000346666376437323039663061656330317D 112 | :1006F00037386437626138620D0A006433616261C1 113 | :1007000064666536656265623733363664376231F2 114 | :1007100031663063626664343337316462616466C3 115 | :1007200035663534386536303634346233333635F1 116 | :1007300061363534623865666532646533326262CB 117 | :10074000623163633032383864333637633065384A 118 | :1007500063663961630D0A00303063393065346394 119 | :1007600036356330613936303830646635616166FC 120 | :1007700037336361616631313436616662333634F2 121 | :10078000636233373839346636626237343531382C 122 | :10079000323139316266353737613237373764384D 123 | :1007A0006235646266353762326164396639303287 124 | :1007B00065320D0A000011241FBECFEFD8E0DEBF66 125 | :1007C000CDBF15E0A0E0B1E0E2EDFEE002C0059093 126 | :1007D0000D92AC33B107D9F725E0ACE3B5E001C029 127 | :1007E0001D92AC33B207E1F70E94C2060C94670772 128 | :1007F0000C940000AC0120E030E061507109909150 129 | :10080000C00097FFFCCF9091C6009D3051F0261795 130 | :100810003707ACF7FA01E20FF31F90832F5F3F4FCA 131 | :10082000EECFFA01E20FF31F1082C90108952FEFF6 132 | :1008300080E792E0215080409040E1F700C0000046 133 | :10084000E3E0F3E090E58091C00085FFFCCF90935A 134 | :10085000C6008FE99FE00197F1F700C00000919179 135 | :100860009111F1CFE7E1F3E091E48091C00085FFC1 136 | :10087000FCCF9093C6008FE99FE00197F1F700C08D 137 | :10088000000091919111F1CFE8E5F7E0949199235F 138 | :1008900061F0E9E5F7E08091C00085FFFCCF90931F 139 | :1008A000C600949131969111F6CFEBEFF6E094915A 140 | :1008B000992361F0ECEFF6E08091C00085FFFCCF5A 141 | :1008C0009093C600949131969111F6CFEAEAF6E042 142 | :1008D0009491992361F0EBEAF6E08091C00085FFE6 143 | :1008E000FCCF9093C600949131969111F6CFE1E23E 144 | :1008F000F3E092E48091C00085FFFCCF9093C600A6 145 | :100900008FE99FE00197F1F700C0000091919111EC 146 | :10091000F1CFEDE4F6E09491992361F0EEE4F6E096 147 | :100920008091C00085FFFCCF9093C60094913196D2 148 | :100930009111F6CFE0EFF5E09491992361F0E1EFAA 149 | :10094000F5E08091C00085FFFCCF9093C6009491A4 150 | :1009500031969111F6CFEFE9F5E09491992361F08A 151 | :10096000E0EAF5E08091C00085FFFCCF9093C600DF 152 | :10097000949131969111F6CFE9E2F3E093E48091FE 153 | :10098000C00085FFFCCF9093C6008FE99FE00197E0 154 | :10099000F1F700C0000091919111F1CFE2E4F5E090 155 | :1009A0009491992361F0E3E4F5E08091C00085FF24 156 | :1009B000FCCF9093C600949131969111F6CFE5EE5D 157 | :1009C000F4E09491992361F0E6EEF4E08091C000A8 158 | :1009D00085FFFCCF9093C600949131969111F6CF8C 159 | :1009E000E4E9F4E09491992361F0E5E9F4E0809181 160 | :1009F000C00085FFFCCF9093C60094913196911171 161 | :100A0000F6CFE2E3F3E094E48091C00085FFFCCFF1 162 | :100A10009093C6008FE99FE00197F1F700C00000B6 163 | :100A200091919111F1CFE7E3F4E09491992361F072 164 | :100A3000E8E3F4E08091C00085FFFCCF9093C6000E 165 | :100A4000949131969111F6CFEAEDF3E094919923C8 166 | :100A500061F0EBEDF3E08091C00085FFFCCF909357 167 | :100A6000C600949131969111F6CFE9E8F3E09491A4 168 | :100A7000992361F0EAE8F3E08091C00085FFFCCFA4 169 | :100A80009093C600949131969111F6CFECE3F3E088 170 | :100A900095E48091C00085FFFCCF9093C6008FE95C 171 | :100AA0009FE00197F1F700C0000091919111F1CF03 172 | :100AB000ECE2F3E09491992361F0EDE2F3E08091B0 173 | :100AC000C00085FFFCCF9093C600949131969111A0 174 | :100AD000F6CFEFECF2E09491992361F0E0EDF2E0D3 175 | :100AE0008091C00085FFFCCF9093C6009491319611 176 | :100AF0009111F6CFEEE7F2E09491992361F0EFE7E0 177 | :100B0000F2E08091C00085FFFCCF9093C6009491E5 178 | :100B100031969111F6CFE7E4F3E096E48091C000BE 179 | :100B200085FFFCCF9093C6008FE99FE00197F1F716 180 | :100B300000C0000091919111F1CFE1E2F2E09491B7 181 | :100B4000992361F0E2E2F2E08091C00085FFFCCFE2 182 | :100B50009093C600949131969111F6CFE4ECF1E0B8 183 | :100B60009491992361F0E5ECF1E08091C00085FF5C 184 | :100B7000FCCF9093C600949131969111F6CFE3E7A4 185 | :100B8000F1E09491992361F0E4E7F1E08091C000F5 186 | :100B900085FFFCCF9093C600949131969111F6CFCA 187 | :100BA000E1E5F3E097E48091C00085FFFCCF9093EE 188 | :100BB000C6008FE99FE00197F1F700C00000919116 189 | :100BC0009111F1CFE6E1F1E09491992361F0E7E131 190 | :100BD000F1E08091C00085FFFCCF9093C600949116 191 | :100BE00031969111F6CFE9EBF0E09491992361F001 192 | :100BF000EAEBF0E08091C00085FFFCCF9093C60047 193 | :100C0000949131969111F6CFE8E6F0E09491992312 194 | :100C100069F0E9E6F0E08091C00085FFFCCF909399 195 | :100C2000C600949131969111F6CF089508950F93CF 196 | :100C30001F93CF93DF93CDB7DEB7C450D1400FB62B 197 | :100C4000F894DEBF0FBECDBF8E010F5F1F4F84E053 198 | :100C500091E0D801FC011D923197E9F7EAE5F3E054 199 | :100C600025E49091C00095FFFCCF2093C6008FE94A 200 | :100C70009FE00197F1F700C0000021912111F1CF11 201 | :100C800061E071E0C8010E94FA0381E092E0AE01E8 202 | :100C90004F5F5E4FF80161E070E03191DC012D9112 203 | :100CA000CD01321711F060E070E0E417F507A9F705 204 | :100CB0006130710509F440C0E0E0F1E09E01275386 205 | :100CC0003F4F41E050E0D8019D918D0181919817EF 206 | :100CD00011F040E050E002171307A9F74130510529 207 | :100CE000F1F1EFECF3E098E48091C00085FFFCCFD8 208 | :100CF0009093C600AFE9BFE01197F1F700C0000084 209 | :100D000091919111F1CF8091C00085FFFCCF8AE0D5 210 | :100D10008093C600EFE9FFE03197F1F700C00000D3 211 | :100D2000CC5FDE4F0FB6F894DEBF0FBECDBFDF91B4 212 | :100D3000CF911F910F910895E1E7F3E096E4809140 213 | :100D4000C00085FFFCCF9093C6008FE99FE001971C 214 | :100D5000F1F700C0000091919111F1CFE1CFE2EAEB 215 | :100D6000F3E096E48091C00085FFFCCF9093C6002D 216 | :100D70008FE99FE00197F1F700C000009191911178 217 | :100D8000F1CFCECFCF93DF9300D01F92CDB7DEB798 218 | :100D90001092C50083E38093C40088E18093C10072 219 | :100DA00086E08093C2008091C2008F7B8093C20056 220 | :100DB0008091C10080688093C1002FEF80E792E0AE 221 | :100DC000215080409040E1F700C00000ECEEF3E0DD 222 | :100DD00095E48091C00085FFFCCF9093C6008FE919 223 | :100DE0009FE00197F1F700C0000091919111F1CFC0 224 | :100DF000E3E3F4E091E38091C00085FFFCCF9093A2 225 | :100E0000C6008FE99FE00197F1F700C000009191C3 226 | :100E10009111F1CFEFE6F4E092E38091C00085FFFD 227 | :100E2000FCCF9093C6008FE99FE00197F1F700C0D7 228 | :100E3000000091919111F1CFE1EAF4E09AE4809100 229 | :100E4000C00085FFFCCF9093C6008FE99FE001971B 230 | :100E5000F1F700C0000091919111F1CFE6EEF4E0BE 231 | :100E600094E58091C00085FFFCCF9093C6008FE988 232 | :100E70009FE00197F1F700C0000091919111F1CF2F 233 | :100E800019821A821B8262E070E0CE0101960E94F4 234 | :100E9000FA0389818233C1F0813399F0ECE2F5E005 235 | :100EA00097E58091C00085FFFCCF9093C6008FE945 236 | :100EB0009FE00197F1F700C0000091919111F1CFEF 237 | :100EC00085CF0E94170482CF0E9417067FCFF89427 238 | :020ED000FFCF52 239 | :100ED2003830313033623766633734363030623817 240 | :100EE20034346262373336363763326338663233CC 241 | :100EF20061666137313765323565353439373536B4 242 | :100F02003831396135336264383735613739656371 243 | :100F1200633830646264396534313564663464340C 244 | :100F2200333536666236323364613632613633388F 245 | :100F320038643064316266323737646261613630F8 246 | :100F4200323163356535666435316132626130381C 247 | :100F520038626664656532636561383030653530A4 248 | :100F62003135356165613161643761313031386500 249 | :100F720063373632316532646163396431366361B5 250 | :100F82003663313931306565336630333832653036 251 | :100F920061306563613131323464366233353761D1 252 | :100FA20038643636396362613663306432346633AC 253 | :100FB20038346135666332383930646235343334FB 254 | :100FC2003163333833323839653332633732376617 255 | :100FD200003433623364333632613036383365304D 256 | :100FE2006563376464646532623037343832373669 257 | :100FF2006261666364303364383933333239396459 258 | :1010020064363732373635323930623130366265DE 259 | :101012003731306566323661373135346561663174 260 | :10102200663638303566316561383132623635665A 261 | :10103200616162313339336633303066323862345B 262 | :1010420036303037306436386334323066346335A4 263 | :1010520033323662346436356534383638383734AC 264 | :1010620035336436623734636337646161653237BE 265 | :1010720035353638373730316637373038633431C3 266 | :10108200663864326131333830616238613134320A 267 | :1010920066613439393161386531653538616236B6 268 | :1010A2006336373537373832303365613565336605 269 | :1010B2003566303634633063303530303437376537 270 | :1010C20066333733613561343630376437653065BE 271 | :1010D20033005075626C6963204B6579204C6973EB 272 | :1010E200743A200D0A00416C6963653A200D0A00CA 273 | :1010F200426F623A200D0A004361726C3A200D0A77 274 | :101102000044617669643A200D0A00456477617291 275 | :10111200643A200D0A00466C6575723A200D0A0089 276 | :10112200476172793A200D0A00456E746572207427 277 | :101132006865207369676E6174757265200D0A00B7 278 | :10114200464C41473A4575636C31645F6834636B62 279 | :1011520033645F6372797074305F6233666F726595 280 | :101162005F69745F7761735F6330306C21210D0AB0 281 | :1011720000464C41473A4575636C31645F6834639D 282 | :101182006B33645F6372797074305F6233666F725F 283 | :10119200655F69745F7761735F6330306C004865C7 284 | :1011A200792120596F7520617265206E6F742061FC 285 | :1011B2006E2061646D696E210D0A00456269616E7F 286 | :1011C20020436F7270206861732061207265706FB6 287 | :1011D2007369746F727920746F2073746F726520F3 288 | :1011E2006974732061646D696E73747261746F7275 289 | :1011F2007327207075626C6963206B6579732E0D9D 290 | :101202000A003129496620796F7520617265206173 291 | :1012120020637573746F6D657220796F75206361D9 292 | :101222006E206C69737420616C6C20746865207028 293 | :1012320075626C6963206B6579732E0D0A00322921 294 | :10124200496620796F752061726520616E20616444 295 | :101252006D696E20796F752063616E2075706461AF 296 | :10126200746520796F7572206B6579732E0D0A0093 297 | :101272004A757374207369676E2074686520706C98 298 | :1012820061696E74657874202261646D696E2220D2 299 | :10129200616E64206D6F7265206F7074696F6E731A 300 | :1012A2002077696C6C2062652070726F7669646564 301 | :1012B200642E0D0A0054686520706172616D657458 302 | :1012C20065727320746F2062652075736564206691 303 | :1012D2006F7220746865207369676E6174757265D8 304 | :1012E20020617265205348413120616E6420504B69 305 | :1012F2004353315F76315F350D0A0057726F6E6767 306 | :0C130200206F7074696F6E200D0A0000EF 307 | :00000001FF 308 | -------------------------------------------------------------------------------- /challenges/binaries/photo_manager/photo_manager.hex: -------------------------------------------------------------------------------- 1 | :100000000C9434000C9451000C9451000C94510049 2 | :100010000C9451000C9451000C9451000C9451001C 3 | :100020000C9451000C9451000C9451000C9451000C 4 | :100030000C9451000C9451000C9451000C945100FC 5 | :100040000C9451000C9451000C9451000C945100EC 6 | :100050000C9451000C9451000C9451000C945100DC 7 | :100060000C9451000C94510011241FBECFEFD8E026 8 | :10007000DEBFCDBF12E0A0E0B1E0E6E7F1E102C0F3 9 | :1000800005900D92A43DB107D9F723E0A4EDB2E0AD 10 | :1000900001C01D92A335B207E1F70E9453000C94F2 11 | :1000A000B9080C940000CF93DF93CDB7DEB70E9460 12 | :1000B00084020E94D00180E090E0DF91CF9108950A 13 | :1000C000CF93DF9300D0CDB7DEB79A838983898140 14 | :1000D0009A810E94BC039093D6028093D5020F9020 15 | :1000E0000F90DF91CF910895CF93DF9300D01F92AF 16 | :1000F000CDB7DEB789837B836A8380E18F931F92BC 17 | :100100008AE091E0892F8F938AE091E08F930E949B 18 | :1001100063030F900F900F900F90CE01019620E097 19 | :1001200030E1281B390B8A819B81820F931F292F75 20 | :100130002F938F9389E291E0892F8F9389E291E049 21 | :100140008F930E9463030F900F900F900F900F906A 22 | :100150000F900F90DF91CF910895EF920F931F931F 23 | :10016000CF93DF93CDB7DEB729970FB6F894DEBFF4 24 | :100170000FBECDBF8A836B834C833E832D8318874C 25 | :100180000F83E9861F921F9287E491E0892F8F9356 26 | :1001900087E491E08F930E9463030F900F900F907C 27 | :1001A0000F908CE491E0892F8F938CE491E08F93F2 28 | :1001B0000E9463030F900F901A828A81898725C05D 29 | :1001C0008FE491E0892F8F938FE491E08F930E94C9 30 | :1001D00063030F900F90BAC00E94F1028C838C8150 31 | :1001E0008D30C9F08C818A30B1F02D813E818A81B9 32 | :1001F000882F90E0820F931F2C81FC01208389853A 33 | :100200008F5F89878A818F5F8A838A819A818985B6 34 | :10021000981711F3D5CF8B818930B8F08B818F3F40 35 | :10022000A1F08B81882F90E0292F2F938F9389E65F 36 | :1002300091E0892F8F9389E691E08F930E94630369 37 | :100240000F900F900F900F9081C0198251C02D8197 38 | :100250003E818981882F90E0820F931FFC0180816D 39 | :10026000803358F02D813E818981882F90E0820F64 40 | :10027000931FFC0180818A33C0F12D813E818981E9 41 | :10028000882F90E0820F931FFC018081813458F009 42 | :100290002D813E818981882F90E0820F931FFC0180 43 | :1002A00080818B3510F12D813E818981882F90E0EE 44 | :1002B000820F931FFC018081813658F02D813E8191 45 | :1002C0008981882F90E0820F931FFC0180818B37FA 46 | :1002D00060F08BEA91E0892F8F938BEA91E08F9306 47 | :1002E0000E9463030F900F9031C089818F5F8983D3 48 | :1002F0008981883008F4ABCF87EE91E0892F8F9306 49 | :1003000087EE91E08F930E9463030F900F901A8203 50 | :100310000EC02D813E818A81882F90E0820F931F2D 51 | :10032000FC0180810E94A9028A818F5F8A839A8161 52 | :100330008B81981770F38CE491E0892F8F938CE474 53 | :1003400091E08F930E9463030F900F9029960FB650 54 | :10035000F894DEBF0FBECDBFDF91CF911F910F91FB 55 | :10036000EF900895CF93DF93CDB7DEB78091D4029D 56 | :10037000882399F480E090E00E94F6070E943A05F5 57 | :100380000E94350580952EEB9227BC0180E090E01D 58 | :100390000E94FC0781E08093D402DF91CF91089501 59 | :1003A000EF920F931F93CF93DF93CDB7DEB7E39711 60 | :1003B0000FB6F894DEBF0FBECDBF0E94B2010E94FF 61 | :1003C000350524E630E0B9010E94940384569B4F22 62 | :1003D0009A83898389819A810E94600088E08E8354 63 | :1003E0001F821C821B8286E2EDEAF2E0DE01189693 64 | :1003F00001900D928A95E1F78E81882F90E00E94FE 65 | :10040000BC039C838B838B819C8148E050E060E03F 66 | :1004100070E00E94450580EF91E0892F8F9380EF77 67 | :1004200091E08F930E9463030F900F908CEF91E007 68 | :10043000892F8F938CEF91E08F930E9463030F902D 69 | :100440000F90CE018E9663E00E948003CE018E96BF 70 | :10045000FC01208184E192E0FC018081281709F0F1 71 | :1004600041C086E192E0892F8F9386E192E08F93DD 72 | :100470000E9463030F900F908E81882F90E0292FA8 73 | :100480002F938F938EE492E0892F8F938EE492E0E6 74 | :100490008F930E9463030F900F900F900F908E81A7 75 | :1004A000882F90E0292F2F938F9385E792E0892F53 76 | :1004B0008F9385E792E08F930E9463030F900F90D4 77 | :1004C0000F900F9079A94F816E815D819E01285F09 78 | :1004D0003F4F8B819C81E72E89019C01852F0E94D3 79 | :1004E000AD0011C0CE018E96FC0120818BEA92E016 80 | :1004F000FC018081281739F42E818B819C81BC01FD 81 | :10050000822F0E9474007FCFCF93DF9300D0CDB7AE 82 | :10051000DEB783E390E09A83898385EC90E02981BC 83 | :100520003A81232F3327FC01208384EC90E029813A 84 | :10053000FC01208381EC90E028E1FC01208382EC27 85 | :1005400090E026E0FC0120830F900F90DF91CF9187 86 | :100550000895CF93DF931F92CDB7DEB78983000054 87 | :1005600080EC90E0FC018081882F90E080729927D8 88 | :10057000892BB1F386EC90E02981FC0120830F9058 89 | :10058000DF91CF910895CF93DF9300D0CDB7DEB741 90 | :100590009A8389830BC089819A819C012F5F3F4F89 91 | :1005A0003A832983FC0180810E94A90289819A8172 92 | :1005B000FC018081882379F70F900F90DF91CF9114 93 | :1005C0000895CF93DF93CDB7DEB780EC90E0FC01C8 94 | :1005D0008081882314F481E001C080E0DF91CF9115 95 | :1005E0000895CF93DF93CDB7DEB700000E94E102FC 96 | :1005F0008823E1F386EC90E0FC018081DF91CF91CC 97 | :100600000895CF93DF9300D000D000D0CDB7DEB7F0 98 | :100610009D838C836E8319821A8214C00E94F1021A 99 | :100620008B838B818D3019F08B818A3019F481E0B6 100 | :100630008A8308C08C819D812E8149816B810E94B3 101 | :10064000370389838A81882349F38981882F90E041 102 | :100650002C813D81820F931FFC01108226960FB6DC 103 | :10066000F894DEBF0FBECDBFDF91CF910895CF9339 104 | :10067000DF9300D000D01F92CDB7DEB79A83898375 105 | :100680006B834C832D838C81282F30E08D81882FC4 106 | :1006900090E00197281739076CF48C8191E0980F4E 107 | :1006A0009C83882F90E029813A81820F931F2B81B0 108 | :1006B000FC0120838C810F900F900F900F900F9072 109 | :1006C000DF91CF910895CF93DF9300D0CDB7DEB700 110 | :1006D000CE0109969A83898329813A818F819885F1 111 | :1006E000AC0168E770E087ED92E00E944C0587ED71 112 | :1006F00092E00E94C3020F900F90DF91CF91089576 113 | :10070000CF93DF9300D01F92CDB7DEB79A83898352 114 | :100710006B8389819A816B810E9401030F900F90F6 115 | :100720000F90DF91CF91089597FB072E16F4009458 116 | :1007300007D077FD09D00E94A80307FC05D03EF43E 117 | :10074000909581959F4F0895709561957F4F08957D 118 | :10075000AA1BBB1B51E107C0AA1FBB1FA617B707E7 119 | :1007600010F0A61BB70B881F991F5A95A9F7809503 120 | :100770009095BC01CD010895CF93DF938230910510 121 | :1007800010F482E090E0E0915103F091520320E0F8 122 | :1007900030E0C0E0D0E0309711F14081518148173E 123 | :1007A0005907C0F04817590761F482819381209757 124 | :1007B00019F09B838A832BC090935203809351033B 125 | :1007C00026C02115310519F04217530718F49A0174 126 | :1007D000BE01DF01EF010280F381E02DDCCF2115A6 127 | :1007E000310509F1281B390B2430310590F412969C 128 | :1007F0008D919C9113976115710521F0FB019383F5 129 | :10080000828304C09093520380935103FD0132967A 130 | :1008100044C0FD01E20FF31F8193919322503109EF 131 | :100820002D933C933AC020914F0330915003232BDA 132 | :1008300041F4209102013091030130935003209341 133 | :100840004F0320910001309101012115310541F440 134 | :100850002DB73EB74091040150910501241B350B83 135 | :10086000E0914F03F0915003E217F307A0F42E1B21 136 | :100870003F0B2817390778F0AC014E5F5F4F241704 137 | :10088000350748F04E0F5F1F5093500340934F03BE 138 | :100890008193919302C0E0E0F0E0CF01DF91CF912E 139 | :1008A00008950F931F93CF93DF93009709F48CC0A3 140 | :1008B000FC0132971382128200915103109152036E 141 | :1008C0000115110581F420813181820F931F209140 142 | :1008D0004F03309150032817390779F5F0935003EF 143 | :1008E000E0934F0371C0D80140E050E0AE17BF075E 144 | :1008F00050F412962D913C911397AD0121153105BD 145 | :1009000009F1D901F3CF9D01DA013383228360819C 146 | :100910007181860F971F8217930769F4EC01288174 147 | :100920003981260F371F2E5F3F4F318320838A8105 148 | :100930009B8193838283452B29F4F0935203E093A8 149 | :10094000510342C01396FC93EE931297ED01499127 150 | :1009500059919E01240F351FE217F30771F480812E 151 | :100960009181840F951F029611969C938E9382819C 152 | :10097000938113969C938E931297E0E0F0E0D80158 153 | :1009800012968D919C911397009719F0F8018C01A4 154 | :10099000F6CF8D919C9198012E5F3F4F820F931F50 155 | :1009A00020914F03309150032817390769F430978D 156 | :1009B00029F4109252031092510302C01382128242 157 | :1009C0001093500300934F03DF91CF911F910F912C 158 | :1009D00008958F929F92AF92BF92CF92DF92EF9243 159 | :1009E000FF92CF93DF93EC01688179818A819B81AB 160 | :1009F000611571058105910521F464E279ED8BE5BE 161 | :100A000097E02DE133EF41E050E00E941F084901DB 162 | :100A10005A019B01AC01A7EAB1E40E943E086B01B8 163 | :100A20007C01ACEEB4EFA50194010E944C08DC01FE 164 | :100A3000CB018C0D9D1DAE1DBF1DB7FF03C00197DF 165 | :100A4000A109B04888839983AA83BB839F77DF91EC 166 | :100A5000CF91FF90EF90DF90CF90BF90AF909F909D 167 | :100A60008F9008950E94E904089586E091E00E9425 168 | :100A7000E9040895A0E0B0E0809306019093070197 169 | :100A8000A0930801B09309010895DC0101C06D93A2 170 | :100A900041505040E0F70895AEE0B0E0E2E5F5E007 171 | :100AA0000C945F088C01CA0146E04C831A830983C9 172 | :100AB00077FF02C060E070E8FB013197FE83ED83B1 173 | :100AC000A901BC01CE0101960E9478054D815E818D 174 | :100AD00057FD0AC02F813885421753070CF49A013D 175 | :100AE000F801E20FF31F10822E96E4E00C947B08CD 176 | :100AF000ACE0B0E0EEE7F5E00C9451087C016B014E 177 | :100B00008A01FC0117821682838181FFBDC1CE015B 178 | :100B100001964C01F7019381F60193FD859193FFB6 179 | :100B200081916F01882309F4ABC1853239F493FDBB 180 | :100B3000859193FF81916F01853229F4B70190E08F 181 | :100B40000E946007E7CF512C312C20E02032A0F426 182 | :100B50008B3269F030F4803259F0833269F42061CD 183 | :100B60002CC08D3239F0803339F4216026C02260E8 184 | :100B7000246023C0286021C027FD27C030ED380F36 185 | :100B80003A3078F426FF06C0FAE05F9E300D11245B 186 | :100B9000532E13C08AE0389E300D1124332E20626C 187 | :100BA0000CC08E3221F426FD6BC1206406C08C3649 188 | :100BB00011F4206802C0883641F4F60193FD859156 189 | :100BC00093FF81916F018111C1CF982F9F7D955423 190 | :100BD000933028F40C5F1F4FFFE3F9830DC0833679 191 | :100BE00031F0833771F0833509F05BC022C0F80122 192 | :100BF000808189830E5F1F4F44244394512C5401FC 193 | :100C000015C03801F2E06F0E711CF801A080B180B0 194 | :100C100026FF03C0652D70E002C06FEF7FEFC501B6 195 | :100C20002C870E9455072C0183012C852F77222EBB 196 | :100C300017C03801F2E06F0E711CF801A080B1807E 197 | :100C400026FF03C0652D70E002C06FEF7FEFC50186 198 | :100C50002C870E944A072C012C852068222E8301B4 199 | :100C600023FC1BC0832D90E048165906B0F4B70151 200 | :100C700080E290E00E9460073A94F4CFF50127FCEF 201 | :100C8000859127FE81915F01B70190E00E94600786 202 | :100C900031103A94F1E04F1A51084114510471F7A0 203 | :100CA000E5C0843611F0893639F5F80127FF07C011 204 | :100CB00060817181828193810C5F1F4F08C06081C8 205 | :100CC0007181072E000C880B990B0E5F1F4F2F763A 206 | :100CD000722E97FF09C090958095709561957F4F12 207 | :100CE0008F4F9F4F2068722E2AE030E0A4010E94AF 208 | :100CF0009807A82EA81844C0853729F42F7EB22E55 209 | :100D00002AE030E025C0F22FF97FBF2E8F36C1F0E8 210 | :100D100018F4883579F0B4C0803719F0883721F09D 211 | :100D2000AFC02F2F2061B22EB4FE0DC08B2D84607A 212 | :100D3000B82E09C024FF0AC09F2F9660B92E06C0A6 213 | :100D400028E030E005C020E130E002C020E132E0E0 214 | :100D5000F801B7FE07C060817181828193810C5FC9 215 | :100D60001F4F06C06081718180E090E00E5F1F4FD1 216 | :100D7000A4010E949807A82EA818FB2DFF777F2EAC 217 | :100D800076FE0BC0372D3E7FA51450F474FE0AC0CA 218 | :100D900072FC08C0372D3E7E05C0BA2C372D03C02B 219 | :100DA000BA2C01C0B52C34FF0DC0FE01EA0DF11DB7 220 | :100DB0008081803311F4397E09C032FF06C0B394BC 221 | :100DC000B39404C0832F867809F0B39433FD13C025 222 | :100DD00030FF06C05A2CB31418F4530C5B18B32C14 223 | :100DE000B31468F4B70180E290E03C870E9460078A 224 | :100DF000B3943C85F5CFB31410F43B1801C0312CEB 225 | :100E000034FF12C0B70180E390E03C870E94600786 226 | :100E10003C8532FF17C031FD03C088E790E002C077 227 | :100E200088E590E0B7010CC0832F867859F031FF38 228 | :100E300002C08BE201C080E237FD8DE2B70190E095 229 | :100E40000E946007A51438F4B70180E390E00E9487 230 | :100E500060075A94F7CFAA94F401EA0DF11D80813E 231 | :100E6000B70190E00E946007A110F5CF332009F48C 232 | :100E700051CEB70180E290E00E9460073A94F6CF2D 233 | :100E8000F7018681978102C08FEF9FEF2C96E2E1F8 234 | :100E90000C946D08FC010590615070400110D8F76A 235 | :100EA000809590958E0F9F1F0895FC0161507040B2 236 | :100EB00001900110D8F7809590958E0F9F1F08958F 237 | :100EC0000F931F93CF93DF93FB01238121FD03C079 238 | :100ED0008FEF9FEF28C022FF16C0468157812481E3 239 | :100EE00035814217530744F4A081B1819D012F5FE2 240 | :100EF0003F4F318320838C93268137812F5F3F4F73 241 | :100F00003783268310C0EB01092F182F0084F18549 242 | :100F1000E02D0995892BE1F68E819F8101969F83B3 243 | :100F20008E83812F902FDF91CF911F910F91089584 244 | :100F3000FA01AA27283051F1203181F1E8946F930A 245 | :100F40006E7F6E5F7F4F8F4F9F4FAF4FB1E03ED0B0 246 | :100F5000B4E03CD0670F781F891F9A1FA11D680F4E 247 | :100F6000791F8A1F911DA11D6A0F711D811D911D81 248 | :100F7000A11D20D009F468943F912AE0269F1124F6 249 | :100F80003019305D3193DEF6CF010895462F47705A 250 | :100F9000405D4193B3E00FD0C9F7F6CF462F4F70B5 251 | :100FA000405D4A3318F0495D31FD4052419302D013 252 | :100FB000A9F7EACFB4E0A6959795879577956795B9 253 | :100FC000BA95C9F700976105710508959B01AC01B9 254 | :100FD0000A2E06945795479537952795BA95C9F7E0 255 | :100FE000620F731F841F951FA01D0895A8E1B0E034 256 | :100FF00042E050E00C9403080E941108272F0C9443 257 | :101000001208DC01CB01FC01F999FECF06C0F2BD4C 258 | :10101000E1BDF89A319600B40D9241505040B8F7B6 259 | :101020000895262FF999FECF1FBA92BD81BD20BD2C 260 | :101030000FB6F894FA9AF99A0FBE01960895052E04 261 | :1010400097FB1EF400940E94360857FD07D00E94BB 262 | :10105000880807FC03D04EF40C9436085095409550 263 | :10106000309521953F4F4F4F5F4F08959095809554 264 | :10107000709561957F4F8F4F9F4F08950E94AA08EA 265 | :10108000A59F900DB49F900DA49F800D911D1124DC 266 | :101090000895B7FF0C943E080E943E08821B930BF4 267 | :1010A00008952F923F924F925F926F927F928F920C 268 | :1010B0009F92AF92BF92CF92DF92EF92FF920F93E7 269 | :1010C0001F93CF93DF93CDB7DEB7CA1BDB0B0FB6F1 270 | :1010D000F894DEBF0FBECDBF09942A8839884888AE 271 | :1010E0005F846E847D848C849B84AA84B984C88444 272 | :1010F000DF80EE80FD800C811B81AA81B981CE0F3B 273 | :10110000D11D0FB6F894DEBF0FBECDBFED0108951F 274 | :10111000A1E21A2EAA1BBB1BFD010DC0AA1FBB1FFB 275 | :10112000EE1FFF1FA217B307E407F50720F0A21B6D 276 | :10113000B30BE40BF50B661F771F881F991F1A94DA 277 | :1011400069F760957095809590959B01AC01BD0104 278 | :10115000CF010895A29FB001B39FC001A39F700D5E 279 | :10116000811D1124911DB29F700D811D1124911DAF 280 | :061170000895F894FFCF82 281 | :1011760000005303200001000000546F74616C20CE 282 | :101186006D656D6F72792073706163653A202564B1 283 | :101196002062797465730D0A004D656D6F72792052 284 | :1011A600737061636520757365643A2025642062F7 285 | :1011B600797465730D0A0025630D0A000D0A005344 286 | :1011C6007461636B20636F6F6B696520636F727206 287 | :1011D60075707465642E0D0A00546865206C656E22 288 | :1011E600677468206973206E6F7420657175616C11 289 | :1011F60020746F203820616E796D6F72652E2049DC 290 | :101206007420697320666F756E6420746F20626542 291 | :10121600202564206E6F772E0D0A00486172647770 292 | :1012260061726520746F6B656E7320617265206EE6 293 | :101236006F74206F6620676976656E204153434957 294 | :1012460049207375622D7365742E2041626F727426 295 | :10125600696E672E0D0A0057656C636F6D65200019 296 | :101266005B315D204C6F67696E0D0A005B325D2055 297 | :101276004D656D6F7279206D616E6167656D656E26 298 | :10128600740D0A003100506C6561736520617574D8 299 | :1012960068656E74696361746520796F75727365CC 300 | :1012A6006C66207769746820796F75722068617240 301 | :1012B600647761726520746F6B656E0D0A00506C01 302 | :1012C6006561736520696E7365727420746F6B65F2 303 | :1012D6006E2E2028256420636861726163746572CE 304 | :1012E60073290D0A00546F6B656E2063616E206F63 305 | :1012F6006E6C7920636F6E7461696E207468652008 306 | :1013060063686172616374657273205B412D5A2F45 307 | :10131600612D7A2F302D395D0D0A003200464C4181 308 | :10132600473A4431645F7930755F736D3473685F33 309 | :101336006D795F737461636B5F62726F3F2020200B 310 | :041346002020000063 311 | :00000001FF 312 | -------------------------------------------------------------------------------- /challenges/binaries/animals/animals.hex: -------------------------------------------------------------------------------- 1 | :100000000C9436020C9453020C9453020C94530239 2 | :100010000C9453020C9453020C9453020C9453020C 3 | :100020000C9453020C9453020C9453020C945302FC 4 | :100030000C9453020C9453020C9453020C945302EC 5 | :100040000C9453020C9453020C9453020C945302DC 6 | :100050000C9453020C9453020C9453020C945302CC 7 | :100060000C9453020C945302626262626262626296 8 | :100070006262626262626262626262626262626260 9 | :100080006262626262626262626262626262626250 10 | :100090006262626262626262626262626262626240 11 | :1000A0006262626262626262626262626262626230 12 | :1000B0006262626262626262626262626262626220 13 | :1000C0006262626262626262626262626262626210 14 | :1000D0006262626262626262626262626262626200 15 | :1000E00062626262626262626262626262626262F0 16 | :1000F0006262626262626262626262031D036262E3 17 | :10010000626262626262626262626A6F6C6F6B629A 18 | :1001100062626262626262626262623E6F3E6262FA 19 | :10012000626262626262626262626D6262621E62E8 20 | :100130006262626262626262623E62626262623EE7 21 | :100140006262621D1D626262623E62623E3E623EA9 22 | :1001500062623E62621E1D1D62621E1D3E3E1D6D7C 23 | :100160001D6D626262626262006363636363636304 24 | :10017000636363636363636363636363636363634F 25 | :10018000636363636363636363636363636363633F 26 | :10019000636363636363636363636363636363632F 27 | :1001A000636363636363636363636363636363631F 28 | :1001B000636363636363636363636363636363630F 29 | :1001C00063636363636363636363636363636363FF 30 | :1001D00063636363636363636363636363636363EF 31 | :1001E00063636363636363636363636363636363DF 32 | :1001F00063636363636363636363636363636363CF 33 | :100200006363636D6E6D1C636363636363636363E6 34 | :100210006363381C3E1D636A2C381F1C1C1C1C1C8D 35 | :100220001C1C1C6C6C3D236363636B6363636363BF 36 | :10023000636363636A63636363636C3F3F3D3D3D38 37 | :100240003D3D3F3F1F636363633F1C1F1F1C636390 38 | :1002500063631F1F1C1F1C636361646361616463CC 39 | :1002600063636361616461646300646464646464BF 40 | :10027000646464646464646464646464646464643E 41 | :10028000646464646464646464646464646464642E 42 | :10029000646464646464646464646464646464641E 43 | :1002A000646464646464646464646464646464640E 44 | :1002B00064646464646464646464646464646464FE 45 | :1002C00064646464646464646464646464646464EE 46 | :1002D00064646464646464646464646464646464DE 47 | :1002E00064646464646464646464646464646464CE 48 | :1002F00064646464646464646464646464646464BE 49 | :1003000064646464646464646464646464646464AD 50 | :10031000646464646464646464646464646464649D 51 | :10032000646464646464646464646464646464648D 52 | :10033000646464646464646464646464646464647D 53 | :100340001B1B1B1B6C6D6C6D646464646464646B68 54 | :1003500064646464646404046464243A3A3A3A1851 55 | :100360001B7F291B1B296A1B7A2B00DFD5D8DEA334 56 | :10037000B9B9B9B9B9B9B9B9B9B9B9C3D6D6DCC17E 57 | :10038000C9D5D6D0CDD8CDD0D6D7B9B9B9B9B9B9E4 58 | :10039000B9B6B9B9B9B9B9B9B9B9B9B9B9B9B9B9D0 59 | :1003A000B6B9B9B9B9B9B9B9B9B9B9B9B9C6C6C699 60 | :1003B000C5C6C6C6C6C6C6B9B9B9B9B9B6B9C6C63C 61 | :1003C000C6B9B9C6C6C6B9C5B9B9B9B6B9B6B9D943 62 | :1003D000B9C5B6B9D9B9C5B9C5B9B9C5B9C5C6C61A 63 | :1003E000C6B6C5C6C6C6B6B9B6C5B9B9C5C6C6C607 64 | :1003F000C6C5B6C6C6C6C6B6E5E5B9B9B6B9B9B9D1 65 | :10040000B9B9B6C5C5C5C5C5B6B6B9B9E5B9B9B9FD 66 | :10041000B9B9E5C5C5C5C5C5C5B9B9B9B9C5B9B9CC 67 | :10042000B9B9B9B9C5C5C5C5C5C5B9B9B9B9C5C6DB 68 | :10043000C6C6C6C6C6B6C5C5C5C5B9B9B9B9B9C6B1 69 | :10044000E5E5C6E5E5C6B9B9B9B9B9B9B9B9B9B952 70 | :10045000B4B4B9B4B4B9B9B9B9B9B90000000000BD 71 | :1004600000000000000000000000000011241FBE7A 72 | :10047000CFEFD8E0DEBFCDBF11E0A0E0B1E0ECED02 73 | :10048000F3E102C005900D92A636B107D9F722E03C 74 | :10049000A6E6B1E001C01D92AA31B207E1F70E94C1 75 | :1004A00087050C94EC090C940000CF93DF9300D0E7 76 | :1004B000CDB7DEB7CE0109969A83898329813A8127 77 | :1004C0008F819885AC0168E770E086E691E00E9434 78 | :1004D0000B0786E691E00E94C9020F900F90DF9112 79 | :1004E000CF910895CF93DF9300D01F92CDB7DEB7A1 80 | :1004F0009A8389836B8389819A816B810E940F0320 81 | :100500000F900F900F90DF91CF910895CF93DF93CD 82 | :1005100000D0CDB7DEB783E390E09A83898385EC82 83 | :1005200090E029813A81232F3327FC01208384EC3A 84 | :1005300090E02981FC01208381EC90E028E1FC011E 85 | :10054000208382EC90E026E0FC0120830F900F9046 86 | :10055000DF91CF910895CF93DF931F92CDB7DEB790 87 | :100560008983000080EC90E0FC018081882F90E07E 88 | :100570008072992721E0892B09F020E0222391F74E 89 | :1005800086EC90E02981FC0120830F90DF91CF91D0 90 | :100590000895CF93DF9300D0CDB7DEB79A838983D8 91 | :1005A0000BC089819A819C012F5F3F4F3A83298339 92 | :1005B000FC0180810E94AB0289819A81FC018081CB 93 | :1005C000882379F70F900F90DF91CF910895CF9303 94 | :1005D000DF93CDB7DEB780EC90E0FC018081881F0F 95 | :1005E0008827881F882311F081E001C080E0DF9117 96 | :1005F000CF910895CF93DF93CDB7DEB700000E946F 97 | :10060000E702982F81E0992309F080E08823B9F769 98 | :1006100086EC90E0FC018081DF91CF910895CF932B 99 | :10062000DF93CDB7DEB727970FB6F894DEBF0FBEC6 100 | :10063000CDBF9E838D836F8319821A8228C00E944A 101 | :10064000FA028B838B818D30D1F40E94FA028C8365 102 | :100650008C818A3019F481E08A8319C08D819E8152 103 | :100660002F8149816B810E945D0389838D819E81E9 104 | :100670002F8149816C810E945D03898308C08D812F 105 | :100680009E812F8149816B810E945D0389838A81CC 106 | :100690008823A9F28981882F90E02D813E81820FE5 107 | :1006A000931FFC011082898127960FB6F894DEBF54 108 | :1006B0000FBECDBFDF91CF910895CF93DF9300D0D0 109 | :1006C00000D01F92CDB7DEB79A8389836B834C83AA 110 | :1006D0002D838C81282F30E08D81882F90E0019729 111 | :1006E000281739076CF48C8191E0980F9C83882F30 112 | :1006F00090E029813A81820F931F2B81FC01208396 113 | :100700008C810F900F900F900F900F90DF91CF91F1 114 | :100710000895CF93DF93CDB7DEB7FFCFCF93DF93AD 115 | :10072000CDB7DEB728970FB6F894DEBF0FBECDBFAA 116 | :100730009A8389837C836B832D833E834F83588781 117 | :1007400089819A8124E631E0FC013183208329816B 118 | :100750003A818D819E81AF81B885F901848395832B 119 | :10076000A683B78389819A812B813C81FC013383E5 120 | :10077000228328960FB6F894DEBF0FBECDBFDF915F 121 | :10078000CF910895CF93DF93CDB7DEB729970FB6FA 122 | :10079000F894DEBF0FBECDBF9987888719821A8271 123 | :1007A0001B821C8242C089819A81AB81BC818F707F 124 | :1007B0009927AA27BB27892B8A2B8B2B59F480E0FA 125 | :1007C00091E0892F8F9380E091E08F930E945502F2 126 | :1007D0000F900F9088859985FC0180819181FC01A3 127 | :1007E0002081318188859985FC01428153818981ED 128 | :1007F0009A81840F951F9E838D838D819E81FC013C 129 | :1008000084918F834F8188859985642FF90109959B 130 | :100810000E94AB0289819A81AB81BC810196A11DA6 131 | :10082000B11D89839A83AB83BC8388859985FC013C 132 | :10083000248135814681578189819A81AB81BC8130 133 | :1008400082179307A407B50708F4ADCF80E091E0C5 134 | :10085000892F8F9380E091E08F930E9455020F9033 135 | :100860000F9029960FB6F894DEBF0FBECDBFDF9173 136 | :10087000CF910895CF93DF93CDB7DEB728970FB60A 137 | :10088000F894DEBF0FBECDBF9A8389837C836B83D0 138 | :100890002D833E834F835887E981FA818D819E8124 139 | :1008A000AF81B8856B817C819C01AD01CF010E9435 140 | :1008B0008E0389819A812EE531E0FC01318320830A 141 | :1008C00028960FB6F894DEBF0FBECDBFDF91CF9153 142 | :1008D0000895CF93DF9300D01F92CDB7DEB79A83F0 143 | :1008E00089836B839B8182E489270F900F900F90FF 144 | :1008F000DF91CF910895CF93DF93CDB7DEB72897DF 145 | :100900000FB6F894DEBF0FBECDBF9A8389837C8378 146 | :100910006B832D833E834F835887E981FA818D81D4 147 | :100920009E81AF81B8856B817C819C01AD01CF0137 148 | :100930000E948E0389819A8128E531E0FC01318390 149 | :10094000208328960FB6F894DEBF0FBECDBFDF918F 150 | :10095000CF910895CF93DF9300D01F92CDB7DEB72C 151 | :100960009A8389836B839B8183E489270F900F90FF 152 | :100970000F90DF91CF910895CF93DF93CDB7DEB77E 153 | :1009800028970FB6F894DEBF0FBECDBF9A83898338 154 | :100990007C836B832D833E834F835887E981FA8163 155 | :1009A0008D819E81AF81B8856B817C819C01AD0179 156 | :1009B000CF010E948E0389819A8122E531E0FC01FA 157 | :1009C0003183208328960FB6F894DEBF0FBECDBFCB 158 | :1009D000DF91CF910895CF93DF9300D01F92CDB7D1 159 | :1009E000DEB79A8389836B839B8184E489270F9088 160 | :1009F0000F900F90DF91CF910895CF93DF93CDB7F4 161 | :100A0000DEB728970FB6F894DEBF0FBECDBF9A832E 162 | :100A100089837C836B832D833E834F835887E98151 163 | :100A2000FA818D819E81AF81B8856B817C819C012B 164 | :100A3000AD01CF010E948E0389819A812CE431E0BF 165 | :100A4000FC013183208328960FB6F894DEBF0FBED9 166 | :100A5000CDBFDF91CF910895CF93DF9300D01F9248 167 | :100A6000CDB7DEB79A8389836B839B8189E9892718 168 | :100A70000F900F900F90DF91CF910895CF93DF9358 169 | :100A800000D01F92CDB7DEB79B838A83198236C010 170 | :100A90008981882F90E02A813B81820F931FFC017E 171 | :100AA00080818034A4F48981882F90E02A813B8161 172 | :100AB000820F931FFC01808188334CF08981882F3D 173 | :100AC00090E02A813B81820F931FFC011082898173 174 | :100AD000882F90E02A813B81820F931FFC01808147 175 | :100AE000853249F48981882F90E02A813B81820FE9 176 | :100AF000931FFC01108289818F5F898389818C33E8 177 | :100B000038F20F900F900F90DF91CF910895CF930F 178 | :100B1000DF93CDB7DEB7CB56D1090FB6F894DEBF61 179 | :100B20000FBECDBF0E9486021982CE01409620E002 180 | :100B300031E040E050E068E670E00E943A04CE0107 181 | :100B4000489620E031E040E050E069E671E00E9424 182 | :100B50007B04CE01809620E031E040E050E06AE680 183 | :100B600072E00E94BC04CE01889620E031E040E0B3 184 | :100B700050E06BE673E00E94FD04CE01C0964CE3AA 185 | :100B800050E060E070E00E940407CE01C0969B83B5 186 | :100B90008A838A819B819D838C838A819B810A962B 187 | :100BA0009B838A838A819B819F838E838A819B8199 188 | :100BB00001969B838A838A819B8101969B838A838A 189 | :100BC0008A819B81998788878A819B8108969B83EC 190 | :100BD0008A838A819B819B878A878A819B810896E9 191 | :100BE0009B838A838A819B819D878C878A819B8155 192 | :100BF00008969B838A838A819B819F878E878A81BF 193 | :100C00009B8108969B838A83CE01C0964CE350E07B 194 | :100C100060E070E00E9404079E01205F3F4F8885DE 195 | :100C2000998548E050E0B9010E94FB069E01285ECC 196 | :100C30003F4F8A859B8548E050E0B9010E94FB0642 197 | :100C40009E01205E3F4F8C859D8548E050E0B901B4 198 | :100C50000E94FB069E01285D3F4F8E859F8548E0E0 199 | :100C600050E0B9010E94FB0683E091E0892F8F9349 200 | :100C700083E091E08F930E9455020F900F9084E1E2 201 | :100C800091E0892F8F9384E191E08F930E94550228 202 | :100C90000F900F908DE191E0892F8F938DE191E07E 203 | :100CA0008F930E9455020F900F9086E291E0892F5A 204 | :100CB0008F9386E291E08F930E9455020F900F90E0 205 | :100CC00081E391E0892F8F9381E391E08F930E94DC 206 | :100CD00055020F900F908E819F81FC0110826CE372 207 | :100CE0008EED91E00E947202282F8E819F81FC017F 208 | :100CF00020838EED91E00E943E058E819F81FC0154 209 | :100D00008081282F30E08C819D81A9016EED71E0FA 210 | :100D10000E94FB0680E091E0892F8F9380E091E0B4 211 | :100D20008F930E9455020F900F9086E391E0892FD8 212 | :100D30008F9386E391E08F930E9455020F900F905E 213 | :100D400019821CC08981882F90E02C813D81280F59 214 | :100D5000391FCE01C096CB968217930708F415C0B1 215 | :100D60008981882F90E02C813D81820F931FFC01A7 216 | :100D700080810E94AB0289818F5F89838E819F81F0 217 | :100D8000FC01908189818917E8F280E091E0892F48 218 | :100D90008F9380E091E08F930E9455020F900F9007 219 | :100DA0008C819D81FC018081082E000C990B84367A 220 | :100DB000910559F08D36910569F08336910579F4E6 221 | :100DC000888599850E94C20315C08A859B850E94EB 222 | :100DD000C20310C08C859D850E94C2030BC081E4B4 223 | :100DE00091E0892F8F9381E491E08F930E945502C7 224 | :100DF0000F900F9009CFFB01DC0102C001900D9212 225 | :100E000041505040D8F70895DC0101C06D93415026 226 | :100E10005040E0F70895AEE0B0E0E1E1F7E00C9477 227 | :100E2000C3098C01CA0146E04C831A83098377FF0A 228 | :100E300002C060E070E8FB013197FE83ED83A901F9 229 | :100E4000BC01CE0101960E9437074D815E8157FD9E 230 | :100E50000AC02F813885421753070CF49A01F80114 231 | :100E6000E20FF31F10822E96E4E00C94DF09ACE051 232 | :100E7000B0E0EDE3F7E00C94B5097C016B018A0169 233 | :100E8000FC0117821682838181FFBDC1CE010196CC 234 | :100E90004C01F7019381F60193FD859193FF8191B8 235 | :100EA0006F01882309F4ABC1853239F493FD859134 236 | :100EB00093FF81916F01853229F4B70190E00E9480 237 | :100EC0001F09E7CF512C312C20E02032A0F48B32C7 238 | :100ED00069F030F4803259F0833269F420612CC01B 239 | :100EE0008D3239F0803339F4216026C022602460CD 240 | :100EF00023C0286021C027FD27C030ED380F3A30CD 241 | :100F000078F426FF06C0FAE05F9E300D1124532EC0 242 | :100F100013C08AE0389E300D1124332E20620CC09D 243 | :100F20008E3221F426FD6BC1206406C08C3611F48C 244 | :100F3000206802C0883641F4F60193FD859193FF45 245 | :100F400081916F018111C1CF982F9F7D955493306E 246 | :100F500028F40C5F1F4FFFE3F9830DC0833631F097 247 | :100F6000833771F0833509F05BC022C0F8018081BE 248 | :100F700089830E5F1F4F44244394512C540115C0A4 249 | :100F80003801F2E06F0E711CF801A080B18026FFDD 250 | :100F900003C0652D70E002C06FEF7FEFC5012C87A5 251 | :100FA0000E9414092C0183012C852F77222E17C053 252 | :100FB0003801F2E06F0E711CF801A080B18026FFAD 253 | :100FC00003C0652D70E002C06FEF7FEFC5012C8775 254 | :100FD0000E9409092C012C852068222E830123FC04 255 | :100FE0001BC0832D90E048165906B0F4B70180E28B 256 | :100FF00090E00E941F093A94F4CFF50127FC8591F7 257 | :1010000027FE81915F01B70190E00E941F09311016 258 | :101010003A94F1E04F1A51084114510471F7E5C0B8 259 | :10102000843611F0893639F5F80127FF07C0608151 260 | :101030007181828193810C5F1F4F08C06081718133 261 | :10104000072E000C880B990B0E5F1F4F2F76722E08 262 | :1010500097FF09C090958095709561957F4F8F4F50 263 | :101060009F4F2068722E2AE030E0A4010E945709A9 264 | :10107000A82EA81844C0853729F42F7EB22E2AE066 265 | :1010800030E025C0F22FF97FBF2E8F36C1F018F463 266 | :10109000883579F0B4C0803719F0883721F0AFC0B7 267 | :1010A0002F2F2061B22EB4FE0DC08B2D8460B82E80 268 | :1010B00009C024FF0AC09F2F9660B92E06C028E001 269 | :1010C00030E005C020E130E002C020E132E0F8016C 270 | :1010D000B7FE07C060817181828193810C5F1F4FD1 271 | :1010E00006C06081718180E090E00E5F1F4FA40117 272 | :1010F0000E945709A82EA818FB2DFF777F2E76FE99 273 | :101100000BC0372D3E7FA51450F474FE0AC072FC4C 274 | :1011100008C0372D3E7E05C0BA2C372D03C0BA2C2F 275 | :1011200001C0B52C34FF0DC0FE01EA0DF11D808118 276 | :10113000803311F4397E09C032FF06C0B394B394F2 277 | :1011400004C0832F867809F0B39433FD13C030FFB9 278 | :1011500006C05A2CB31418F4530C5B18B32CB314F8 279 | :1011600068F4B70180E290E03C870E941F09B394C5 280 | :101170003C85F5CFB31410F43B1801C0312C34FF7B 281 | :1011800012C0B70180E390E03C870E941F093C85B4 282 | :1011900032FF17C031FD03C088E790E002C088E548 283 | :1011A00090E0B7010CC0832F867859F031FF02C060 284 | :1011B0008BE201C080E237FD8DE2B70190E00E9432 285 | :1011C0001F09A51438F4B70180E390E00E941F09BD 286 | :1011D0005A94F7CFAA94F401EA0DF11D8081B7016A 287 | :1011E00090E00E941F09A110F5CF332009F451CEE1 288 | :1011F000B70180E290E00E941F093A94F6CFF70110 289 | :101200008681978102C08FEF9FEF2C96E2E10C94CC 290 | :10121000D109FC010590615070400110D8F780950C 291 | :1012200090958E0F9F1F0895FC01615070400190B2 292 | :101230000110D8F7809590958E0F9F1F08950F93FA 293 | :101240001F93CF93DF93FB01238121FD03C08FEF19 294 | :101250009FEF28C022FF16C0468157812481358127 295 | :101260004217530744F4A081B1819D012F5F3F4F86 296 | :10127000318320838C93268137812F5F3F4F3783C3 297 | :10128000268310C0EB01092F182F0084F185E02D73 298 | :101290000995892BE1F68E819F8101969F838E832C 299 | :1012A000812F902FDF91CF911F910F910895FA0117 300 | :1012B000AA27283051F1203181F1E8946F936E7F95 301 | :1012C0006E5F7F4F8F4F9F4FAF4FB1E03ED0B4E086 302 | :1012D0003CD0670F781F891F9A1FA11D680F791FC7 303 | :1012E0008A1F911DA11D6A0F711D811D911DA11DD8 304 | :1012F00020D009F468943F912AE0269F11243019E8 305 | :10130000305D3193DEF6CF010895462F4770405D82 306 | :101310004193B3E00FD0C9F7F6CF462F4F70405D31 307 | :101320004A3318F0495D31FD4052419302D0A9F78C 308 | :10133000EACFB4E0A6959795879577956795BA9586 309 | :10134000C9F700976105710508959B01AC010A2E4C 310 | :1013500006945795479537952795BA95C9F7620F23 311 | :10136000731F841F951FA01D08952F923F924F92C7 312 | :101370005F926F927F928F929F92AF92BF92CF9225 313 | :10138000DF92EF92FF920F931F93CF93DF93CDB72E 314 | :10139000DEB7CA1BDB0B0FB6F894DEBF0FBECDBFA6 315 | :1013A00009942A88398848885F846E847D848C8477 316 | :1013B0009B84AA84B984C884DF80EE80FD800C8180 317 | :1013C0001B81AA81B981CE0FD11D0FB6F894DEBF63 318 | :0C13D0000FBECDBFED010895F894FFCFD3 319 | :1013DC000D0A000D0A53686F77206D652061200D92 320 | :1013EC000A0D0A00205B635D61740D0A00205B64CA 321 | :1013FC005D6F670D0A00205B6D5D6F7573650D0A7F 322 | :10140C00000D0A3E3E005468697320697320612008 323 | :10141C00003F3F3F3F0D0A00000000002C0500007C 324 | :10142C000000EB0400000000AA04000000006904A6 325 | :06143C000000000089031E 326 | :00000001FF 327 | -------------------------------------------------------------------------------- /src/aesprotected/aesProtected.c: -------------------------------------------------------------------------------- 1 | /* aes.c */ 2 | /* 3 | * This code is/was initially part of the AVR-Crypto-Lib. It is now 4 | * stripped down such that only AES 128 encryption and decryption in 5 | * CBC mode is supported. 6 | * 7 | * Copyright (C) 2016 alegen (alex@alegen.net) 8 | * Copyright (C) 2006-2016 Daniel Otte (bg@nerilex.org) 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "aesProtected.h" 29 | #include 30 | #include "gf256mul.h" 31 | 32 | /* 33 | * Function prototypes which are not public. 34 | */ 35 | 36 | static void aes_rotword(uint32_t* a); 37 | 38 | #if AES_ENCRYPTION 39 | 40 | static void aes_enc_round(aes_state_t data, aes_roundkey_t k); 41 | static void aes_enc_lastround(aes_state_t data, aes_roundkey_t k); 42 | static void aes_shiftrow(uint8_t* row_start, uint8_t shift); 43 | 44 | #endif 45 | 46 | static void aes_dec_firstround(aes_state_t data, aes_roundkey_t k); 47 | static void aes_dec_round(aes_state_t data, aes_roundkey_t k); 48 | static void aes_invshiftrow(uint8_t* row_start, uint8_t shift); 49 | 50 | /* 51 | * Tables with precomputed values. 52 | */ 53 | 54 | const uint8_t PROGMEM aes_sbox[256] = { 55 | 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 56 | 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 57 | 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 58 | 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 59 | 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 60 | 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 61 | 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 62 | 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 63 | 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 64 | 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 65 | 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 66 | 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 67 | 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 68 | 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 69 | 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 70 | 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 71 | 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 72 | 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 73 | 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 74 | 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 75 | 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 76 | 0xb0, 0x54, 0xbb, 0x16}; 77 | 78 | const uint8_t PROGMEM aes_invsbox[256] = { 79 | 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 80 | 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 81 | 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 82 | 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 83 | 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 84 | 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 85 | 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 86 | 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 87 | 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 88 | 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 89 | 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 90 | 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 91 | 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 92 | 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 93 | 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 94 | 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 95 | 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 96 | 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 97 | 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 98 | 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 99 | 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 100 | 0x55, 0x21, 0x0c, 0x7d}; 101 | 102 | const uint8_t PROGMEM rc_tab[] = { 103 | 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c}; 104 | 105 | /* 106 | * AES key expansion code 107 | */ 108 | 109 | void aes_key_expansion(aes_key_t key) { 110 | uint8_t i; 111 | // number of columns (32 bit words) comprising the state 112 | // in generic AES, this is constant to 4 113 | uint8_t nb = 4; 114 | // number of 32 bit words comprising the cipher key 115 | // 4, 6 or 8, but 4 in our case 116 | uint8_t nk = 4; 117 | // number of rounds which is either 10, 12 or 14, but 10 in our case 118 | uint8_t nr = 10; 119 | // union which lets us select easily between 32 bit 120 | // words and individual bytes 121 | union { 122 | uint32_t v32; 123 | uint8_t v8[4]; 124 | } tmp; 125 | for (i = nk; i < nb * (nr + 1); i++) { 126 | SHORTRANDOMDELAY(); 127 | tmp.v32 = ((uint32_t*)key)[i - 1]; 128 | if ( i % nk == 0) { 129 | aes_rotword(&(tmp.v32)); 130 | tmp.v8[0] = pgm_read_byte(aes_sbox + tmp.v8[0]); 131 | tmp.v8[1] = pgm_read_byte(aes_sbox + tmp.v8[1]); 132 | tmp.v8[2] = pgm_read_byte(aes_sbox + tmp.v8[2]); 133 | tmp.v8[3] = pgm_read_byte(aes_sbox + tmp.v8[3]); 134 | tmp.v8[0] ^= pgm_read_byte(rc_tab + i / nk); 135 | } 136 | ((uint32_t*)key)[i] = ((uint32_t*)key)[i - nk] ^ tmp.v32; 137 | } 138 | } 139 | 140 | static void aes_rotword(uint32_t* a) { 141 | uint8_t t; 142 | t = ((uint8_t*)a)[0]; 143 | ((uint8_t*)a)[0] = ((uint8_t*)a)[1]; 144 | ((uint8_t*)a)[1] = ((uint8_t*)a)[2]; 145 | ((uint8_t*)a)[2] = ((uint8_t*)a)[3]; 146 | ((uint8_t*)a)[3] = t; 147 | } 148 | 149 | /* 150 | * AES encryption code. 151 | */ 152 | 153 | #if AES_ENCRYPTION 154 | 155 | void aes_ecb_encrypt_inner(aes_state_t data, aes_key_t key) { 156 | uint8_t i; 157 | uint8_t rounds = 10; 158 | 159 | RANDOMDELAY(); 160 | for (i = 0; i < 16; ++i) { 161 | data[i] ^= key[0 * AES_ROUNDKEY_SIZE + i]; 162 | SHORTRANDOMDELAY(); 163 | } 164 | 165 | i = 1; 166 | for (; rounds > 1; --rounds) { 167 | RANDOMDELAY(); 168 | 169 | executeWithDummies(&aes_enc_round, data, key + i * AES_ROUNDKEY_SIZE); 170 | 171 | ++i; 172 | } 173 | 174 | RANDOMDELAY(); 175 | 176 | executeWithDummies(&aes_enc_lastround, data, key + i * AES_ROUNDKEY_SIZE); 177 | 178 | RANDOMDELAY(); 179 | 180 | } 181 | 182 | 183 | void aes_ecb_encrypt(aes_state_t data, aes_key_t key) { 184 | #if ENABLE_ANTIDFA 185 | uint8_t bufBck[AES_STATE_SIZE]; 186 | aes_state_t dataBck = bufBck; 187 | memcpy(dataBck, data, AES_STATE_SIZE); 188 | #endif 189 | 190 | aes_ecb_encrypt_inner(data, key); 191 | 192 | #if ENABLE_ANTIDFA 193 | 194 | LONGDELAY(); 195 | aes_ecb_encrypt_inner(dataBck, key); 196 | 197 | if (memcmp(data,dataBck,AES_STATE_SIZE) != 0) { 198 | memset(data,0,AES_STATE_SIZE); //Fault detected. Clearing the output 199 | } 200 | 201 | #endif 202 | } 203 | 204 | void aes_cbc_encrypt(aes_state_t data, aes_iv_t iv, aes_key_t key) { 205 | uint8_t i; 206 | for (i = 0; i < AES_STATE_SIZE; i++) 207 | data[i] = data[i] ^ iv[i]; 208 | aes_ecb_encrypt(data, key); 209 | } 210 | 211 | static void aes_enc_round(aes_state_t data, aes_roundkey_t k) { 212 | uint8_t tmp[16], t; 213 | uint8_t i; 214 | 215 | // sub bytes 216 | for (i = 0; i < 16; ++i) { 217 | tmp[i] = pgm_read_byte(aes_sbox + data[i]); 218 | } 219 | 220 | // shift rows 221 | SHORTRANDOMDELAY(); 222 | aes_shiftrow(tmp + 1, 1); 223 | SHORTRANDOMDELAY(); 224 | aes_shiftrow(tmp + 2, 2); 225 | SHORTRANDOMDELAY(); 226 | aes_shiftrow(tmp + 3, 3); 227 | SHORTRANDOMDELAY(); 228 | 229 | // mix colums 230 | for (i = 0; i < 4; ++i) { 231 | t = tmp[4 * i + 0] ^ tmp[4 * i + 1] ^ tmp[4 * i + 2] ^ tmp[4 * i + 3]; 232 | SHORTRANDOMDELAY(); 233 | data[4 * i + 0] = gf256mul(2, tmp[4 * i + 0] ^ tmp[4 * i + 1], 0x1b) ^ 234 | tmp[4 * i + 0] ^ t; 235 | SHORTRANDOMDELAY(); 236 | data[4 * i + 1] = gf256mul(2, tmp[4 * i + 1] ^ tmp[4 * i + 2], 0x1b) ^ 237 | tmp[4 * i + 1] ^ t; 238 | SHORTRANDOMDELAY(); 239 | data[4 * i + 2] = gf256mul(2, tmp[4 * i + 2] ^ tmp[4 * i + 3], 0x1b) ^ 240 | tmp[4 * i + 2] ^ t; 241 | SHORTRANDOMDELAY(); 242 | data[4 * i + 3] = gf256mul(2, tmp[4 * i + 3] ^ tmp[4 * i + 0], 0x1b) ^ 243 | tmp[4 * i + 3] ^ t; 244 | SHORTRANDOMDELAY(); 245 | } 246 | 247 | // add key 248 | for (i = 0; i < 16; ++i) { 249 | data[i] ^= k[i]; 250 | SHORTRANDOMDELAY(); 251 | } 252 | } 253 | 254 | static void aes_enc_lastround(aes_state_t data, aes_roundkey_t k) { 255 | uint8_t i; 256 | 257 | // sub bytes 258 | for (i = 0; i < 16; ++i) { 259 | data[i] = pgm_read_byte(aes_sbox + data[i]); 260 | } 261 | 262 | // shift rows 263 | SHORTRANDOMDELAY(); 264 | aes_shiftrow(data + 1, 1); 265 | SHORTRANDOMDELAY(); 266 | aes_shiftrow(data + 2, 2); 267 | SHORTRANDOMDELAY(); 268 | aes_shiftrow(data + 3, 3); 269 | SHORTRANDOMDELAY(); 270 | 271 | // add key 272 | for (i = 0; i < 16; ++i) { 273 | data[i] ^= k[i]; 274 | SHORTRANDOMDELAY(); 275 | } 276 | } 277 | 278 | static void aes_shiftrow(uint8_t* row_start, uint8_t shift) { 279 | uint8_t row[4]; 280 | row[0] = row_start[ 0]; 281 | row[1] = row_start[ 4]; 282 | row[2] = row_start[ 8]; 283 | row[3] = row_start[12]; 284 | row_start[ 0] = row[ (shift + 0) & 3 ]; 285 | row_start[ 4] = row[ (shift + 1) & 3 ]; 286 | row_start[ 8] = row[ (shift + 2) & 3 ]; 287 | row_start[12] = row[ (shift + 3) & 3 ]; 288 | } 289 | 290 | #endif // AES_ENCRYPTION 291 | 292 | /* 293 | * AES decryption code. 294 | */ 295 | 296 | void aes_ecb_decrypt_inner(aes_state_t data, aes_key_t key) { 297 | uint8_t i; 298 | uint8_t rounds = 10; 299 | i = rounds; 300 | RANDOMDELAY(); 301 | executeWithDummies(&aes_dec_firstround,data, key + i * AES_ROUNDKEY_SIZE); 302 | for (; rounds > 1; --rounds) { 303 | --i; 304 | RANDOMDELAY(); 305 | executeWithDummies(&aes_dec_round,data, key + i * AES_ROUNDKEY_SIZE); 306 | } 307 | RANDOMDELAY(); 308 | for (i = 0; i < 16; ++i) { 309 | SHORTRANDOMDELAY(); 310 | data[i] ^= key[0 * AES_ROUNDKEY_SIZE + i]; 311 | } 312 | RANDOMDELAY(); 313 | } 314 | 315 | 316 | void aes_ecb_decrypt(aes_state_t data, aes_key_t key) { 317 | #if ENABLE_ANTIDFA 318 | uint8_t bufBck[AES_STATE_SIZE]; 319 | aes_state_t dataBck = bufBck; 320 | memcpy(dataBck, data, AES_STATE_SIZE); 321 | 322 | #endif 323 | 324 | aes_ecb_decrypt_inner(data, key); 325 | 326 | #if ENABLE_ANTIDFA 327 | 328 | LONGDELAY(); 329 | 330 | aes_ecb_decrypt_inner(dataBck, key); 331 | 332 | if (memcmp(data,dataBck,AES_STATE_SIZE) != 0) { 333 | memset(data,0,AES_STATE_SIZE); //Fault detected. Clearing the output 334 | } 335 | 336 | #endif 337 | } 338 | 339 | 340 | void aes_cbc_decrypt(aes_state_t data, aes_iv_t iv, aes_key_t key) { 341 | uint8_t i; 342 | aes_ecb_decrypt(data, key); 343 | for (i = 0; i < AES_STATE_SIZE; i++) 344 | data[i] = data[i] ^ iv[i]; 345 | } 346 | 347 | static void aes_dec_firstround(aes_state_t data, aes_roundkey_t k) { 348 | uint8_t i; 349 | 350 | // add key 351 | for (i = 0; i < 16; ++i) { 352 | SHORTRANDOMDELAY(); 353 | data[i] ^= k[i]; 354 | } 355 | 356 | // shift rows 357 | SHORTRANDOMDELAY(); 358 | aes_invshiftrow(data + 1, 1); 359 | SHORTRANDOMDELAY(); 360 | aes_invshiftrow(data + 2, 2); 361 | SHORTRANDOMDELAY(); 362 | aes_invshiftrow(data + 3, 3); 363 | SHORTRANDOMDELAY(); 364 | 365 | // sub bytes 366 | for (i = 0; i < 16; ++i) { 367 | data[i] = pgm_read_byte(aes_invsbox + data[i]); 368 | } 369 | } 370 | 371 | static void aes_dec_round(aes_state_t data, aes_roundkey_t k) { 372 | uint8_t tmp[16]; 373 | uint8_t i; 374 | uint8_t t, u, v, w; 375 | 376 | // add key 377 | for (i = 0; i < 16; ++i) { 378 | SHORTRANDOMDELAY(); 379 | tmp[i] = data[i] ^ k[i]; 380 | } 381 | 382 | // mix colums 383 | for (i = 0; i < 4; ++i) { 384 | SHORTRANDOMDELAY(); 385 | t = tmp[4 * i + 3] ^ tmp[4 * i + 2]; 386 | SHORTRANDOMDELAY(); 387 | u = tmp[4 * i + 1] ^ tmp[4 * i + 0]; 388 | SHORTRANDOMDELAY(); 389 | v = t ^ u; 390 | SHORTRANDOMDELAY(); 391 | v = gf256mul(0x09, v, 0x1b); 392 | SHORTRANDOMDELAY(); 393 | w = v ^ gf256mul(0x04, tmp[4 * i + 2] ^ tmp[4 * i + 0], 0x1b); 394 | SHORTRANDOMDELAY(); 395 | v = v ^ gf256mul(0x04, tmp[4 * i + 3] ^ tmp[4 * i + 1], 0x1b); 396 | SHORTRANDOMDELAY(); 397 | data[4 * i + 3] = tmp[4 * i + 3] ^ v ^ 398 | gf256mul(0x02, tmp[4 * i + 0] ^ tmp[4 * i + 3], 0x1b); 399 | SHORTRANDOMDELAY(); 400 | data[4 * i + 2] = tmp[4 * i + 2] ^ w ^ gf256mul(0x02, t, 0x1b); 401 | SHORTRANDOMDELAY(); 402 | data[4 * i + 1] = tmp[4 * i + 1] ^ v ^ 403 | gf256mul(0x02, tmp[4 * i + 2] ^ tmp[4 * i + 1], 0x1b); 404 | SHORTRANDOMDELAY(); 405 | data[4 * i + 0] = tmp[4 * i + 0] ^ w ^ gf256mul(0x02, u, 0x1b); 406 | } 407 | 408 | // shift rows 409 | SHORTRANDOMDELAY(); 410 | aes_invshiftrow(data + 1, 1); 411 | SHORTRANDOMDELAY(); 412 | aes_invshiftrow(data + 2, 2); 413 | SHORTRANDOMDELAY(); 414 | aes_invshiftrow(data + 3, 3); 415 | SHORTRANDOMDELAY(); 416 | 417 | // sub bytes 418 | for (i = 0; i < 16; ++i) { 419 | data[i] = pgm_read_byte(aes_invsbox + data[i]); 420 | } 421 | } 422 | 423 | static void aes_invshiftrow(uint8_t* row_start, uint8_t shift) { 424 | uint8_t row[4]; 425 | row[0] = row_start[ 0]; 426 | row[1] = row_start[ 4]; 427 | row[2] = row_start[ 8]; 428 | row[3] = row_start[12]; 429 | row_start[ 0] = row[ (4 - shift + 0) & 3 ]; 430 | row_start[ 4] = row[ (4 - shift + 1) & 3 ]; 431 | row_start[ 8] = row[ (4 - shift + 2) & 3 ]; 432 | row_start[12] = row[ (4 - shift + 3) & 3 ]; 433 | } 434 | 435 | 436 | #if ENABLE_RANDOMDELAY 437 | 438 | 439 | void random_delay(uint16_t max_value) { 440 | 441 | volatile uint16_t n = rand() % max_value; 442 | 443 | for (; n > 0; n--) { \ 444 | asm volatile("nop"); \ 445 | } 446 | } 447 | 448 | 449 | #endif 450 | 451 | void delay(uint16_t value) { 452 | volatile uint16_t n =value; 453 | 454 | for (; n > 0; n--) { \ 455 | asm volatile("nop"); \ 456 | } 457 | } 458 | 459 | void executeWithDummies(void (*function)(uint8_t *, uint8_t *), uint8_t *data, uint8_t *key) { 460 | 461 | #if ENABLE_DUMMYROUNDS 462 | 463 | uint8_t randomData[16+16]; 464 | uint8_t i, j; 465 | 466 | uint8_t numDummies = 1 + rand()%3; 467 | uint8_t posRealOp = rand()%numDummies; 468 | 469 | for (i=0; i