diff --git a/tests/test-progs/nops/Makefile b/tests/test-progs/nops/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c8c1b40f63d855b8b0f27de92da68aef21843ba2 --- /dev/null +++ b/tests/test-progs/nops/Makefile @@ -0,0 +1,41 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +DIR = naive layout handler generic_1 generic_2 hello + +binaries: + $(foreach var, $(DIR), make -C src/$(var) secret_$(var);) + +dump: + $(foreach var, $(DIR), make -C src/$(var) dump;) + +clean: + $(foreach var, $(DIR), make -C src/$(var) clean;) + +mrproper: + $(foreach var, $(DIR), make -C src/$(var) mrproper;) diff --git a/tests/test-progs/nops/README.md b/tests/test-progs/nops/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0d88d1900f183a6bd6c9f3671bbdb1a4143e4df1 --- /dev/null +++ b/tests/test-progs/nops/README.md @@ -0,0 +1,23 @@ +# End of the attack + +The following programs crash when the attack is finished: +* secret_layout +* secret_handler +* secret_generic_1 +* secret_hello with `nops-crash.txt` + +The following programs enter in an infinite loop: +* secret_generic_2 +* secret_hello with `nops-loop.txt` + +These behaviors are expected. We leave the CPU registers with non-sense values. + + +# Execution time + +Each use-case takes only few secondes to complete, except the *Hello World!*. This one requires few minutes to complete. With an Intel i7-8650U CPU at 1.90MHz, it is around 10 minutes. + + +# Hello World! + +To see the current status of the attack, comment the line which contains the address 0x105a8. This address is the call to `printf()` in the main function. By doing so, the output string is printed after each new added character. diff --git a/tests/test-progs/nops/bin/MD5SUMS b/tests/test-progs/nops/bin/MD5SUMS new file mode 100644 index 0000000000000000000000000000000000000000..4c95935adca01e2eb32f2422582d618e01ac356d --- /dev/null +++ b/tests/test-progs/nops/bin/MD5SUMS @@ -0,0 +1,6 @@ +0c956bbc1049aa34d11a4f0db3a1e0bd secret_generic_1 +0c956bbc1049aa34d11a4f0db3a1e0bd secret_generic_2 +f8b404b70cba99bd42b65712246b77ea secret_handler +33c1f05c2be5ff65c30441b3d6e8bd5d secret_hello +ea39ea005168e2f1c64e996a89a07bb5 secret_layout +94e4f796332a7cf090da5d9b838746ab secret_naive diff --git a/tests/test-progs/nops/bin/secret_generic_1 b/tests/test-progs/nops/bin/secret_generic_1 new file mode 100755 index 0000000000000000000000000000000000000000..00260a34f6c7493c1e9eafa64515c2b7d6ee526c Binary files /dev/null and b/tests/test-progs/nops/bin/secret_generic_1 differ diff --git a/tests/test-progs/nops/bin/secret_generic_2 b/tests/test-progs/nops/bin/secret_generic_2 new file mode 100755 index 0000000000000000000000000000000000000000..00260a34f6c7493c1e9eafa64515c2b7d6ee526c Binary files /dev/null and b/tests/test-progs/nops/bin/secret_generic_2 differ diff --git a/tests/test-progs/nops/bin/secret_handler b/tests/test-progs/nops/bin/secret_handler new file mode 100755 index 0000000000000000000000000000000000000000..cb6c6476db925003d8698e7dd352ef1529d5cb0e Binary files /dev/null and b/tests/test-progs/nops/bin/secret_handler differ diff --git a/tests/test-progs/nops/bin/secret_hello b/tests/test-progs/nops/bin/secret_hello new file mode 100755 index 0000000000000000000000000000000000000000..1ed0b98d8882edac094a95acfdbb35a68ec97a6c Binary files /dev/null and b/tests/test-progs/nops/bin/secret_hello differ diff --git a/tests/test-progs/nops/bin/secret_layout b/tests/test-progs/nops/bin/secret_layout new file mode 100755 index 0000000000000000000000000000000000000000..a1f93ffc4a2b8686f8a51eb113607cdfbfb9eb1d Binary files /dev/null and b/tests/test-progs/nops/bin/secret_layout differ diff --git a/tests/test-progs/nops/bin/secret_naive b/tests/test-progs/nops/bin/secret_naive new file mode 100755 index 0000000000000000000000000000000000000000..1f6d2ffec6330d2cc5c2d216746a71784c40b159 Binary files /dev/null and b/tests/test-progs/nops/bin/secret_naive differ diff --git a/tests/test-progs/nops/src/generic_1/Makefile b/tests/test-progs/nops/src/generic_1/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..ec142318ca69bb1d53a885268931148ec226ccd0 --- /dev/null +++ b/tests/test-progs/nops/src/generic_1/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 -fomit-frame-pointer +OUT=../../bin + +TARGET=secret_generic_1 + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c aes.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/generic_1/aes.c b/tests/test-progs/nops/src/generic_1/aes.c new file mode 100644 index 0000000000000000000000000000000000000000..96088f23108b9f6dc66972abfdfdfb4088856a85 --- /dev/null +++ b/tests/test-progs/nops/src/generic_1/aes.c @@ -0,0 +1,417 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + +#include "aes.h" + +//---------------------------------------------------------- +// AES128 encryption +//---------------------------------------------------------- +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + +//---------------------------------------------------------- +// AES Round functions +//---------------------------------------------------------- +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +//---------------------------------------------------------- +// Génération de clé +//---------------------------------------------------------- +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE],int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = + sboxtab[column[0]] ^ rcon[round-1] ^ keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey(unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + +//---------------------------------------------------------- +// Other useful functions +//---------------------------------------------------------- +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message[], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey(unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0]= gmul(column_tmp[0],2) ^ gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[1],3); + column[1]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ gmul(column_tmp[3],1); + column[2]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ gmul(column_tmp[3],3); + column[3]= gmul(column_tmp[0],3) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +//---------------------------------------------------------- +// Tables +//---------------------------------------------------------- +unsigned char trigger_sel = 1; + +const unsigned char rcon [10]={0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, + 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, + 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, + 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, + 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, + 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, + 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, + 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, + 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, + 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, + 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, + 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, + 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, + 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }; diff --git a/tests/test-progs/nops/src/generic_1/aes.h b/tests/test-progs/nops/src/generic_1/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..9239b7775e2136a0c25be7bff8280bb49f412bbe --- /dev/null +++ b/tests/test-progs/nops/src/generic_1/aes.h @@ -0,0 +1,52 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + + + +#ifndef AES_H +#define AES_H + +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + +#endif diff --git a/tests/test-progs/nops/src/generic_1/nops.txt b/tests/test-progs/nops/src/generic_1/nops.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1b35dcd33a0fa80b9c3d7515698d322efce159c --- /dev/null +++ b/tests/test-progs/nops/src/generic_1/nops.txt @@ -0,0 +1,623 @@ +# Entry point +10528 +# Then addresses skip +105e8 +105ec +105f0 +105f4 +105f8 +105fc +10600 +10604 +10608 +1060c +10610 +10614 +10618 +1061c +10620 +10624 +10628 +1062c +10630 +10634 +10638 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +1067c +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +106a0 +106a4 +106a8 +106ac +106b0 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +106e4 +106e8 +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +1072c +10730 +10734 +10738 +1073c +10740 +10744 +10748 +1074c +10750 +10754 +10758 +1075c +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +10964 +10968 +1096c +10970 +10974 +10978 +1097c +10980 +10984 +10988 +1098c +10990 +10994 +10998 +1099c +109a0 +109a4 +109a8 +109ac +109b0 +109b4 +109b8 +109bc +109c0 +109c4 +109c8 +109cc +109d0 +109d4 +109d8 +109dc +109e0 +109e4 +109e8 +109ec +109f0 +109f4 +109f8 +109fc +10a00 +10a04 +10a08 +10a0c +10a10 +10a14 +10a18 +10a1c +10a20 +10a24 +10a28 +10a2c +10a30 +10a34 +10a38 +10a3c +10a40 +10a44 +10a48 +10a4c +10a50 +10a54 +10a58 +10a5c +10a60 +10a64 +10a68 +10a6c +10a70 +10a74 +10a78 +10a7c +10a80 +10a84 +10a88 +10a8c +10a90 +10a94 +10a98 +10a9c +10aa0 +10aa4 +10aa8 +10aac +10ab0 +10ab4 +10ab8 +10abc +10ac0 +10ac4 +10ac8 +10acc +10ad0 +10ad4 +10ad8 +10adc +10ae0 +10ae4 +10ae8 +10aec +10af0 +10af4 +10af8 +10afc +10b00 +10b04 +10b08 +10b0c +10b10 +10b14 +10b18 +10b1c +10b20 +10b24 +10b28 +10b2c +10b30 +10b34 +10b38 +10b3c +10b40 +10b44 +10b48 +10b4c +10b50 +10b54 +10b58 +10b5c +10b60 +10b64 +10b68 +10b6c +10b70 +10b74 +10b78 +10b7c +10b80 +10b84 +10b88 +10b8c +10b90 +10b94 +10b98 +10b9c +10ba0 +10ba4 +10ba8 +10bac +10bb0 +10bb4 +10bb8 +10bbc +10bc0 +10bc4 +10bc8 +10bcc +10bd0 +10bd4 +10bd8 +10bdc +10be0 +10be4 +10be8 +10bec +10bf0 +10bf4 +10bf8 +10bfc +10c00 +10c04 +10c08 +10c0c +10c10 +10c14 +10c18 +10c1c +10c20 +10c24 +10c28 +10c2c +10c30 +10c34 +10c38 +10c3c +10c40 +10c44 +10c48 +10c4c +10c50 +10c54 +10c58 +10c5c +10c60 +10c64 +10c68 +10c6c +10c70 +10c74 +10c78 +10c7c +10c80 +10c84 +10c88 +10c8c +10c90 +10c94 +10c98 +10c9c +10ca0 +10ca4 +10ca8 +10cac +10cb0 +10cb4 +10cb8 +10cbc +10cc0 +10cc4 +10cc8 +10ccc +10cd0 +10cd4 +10cd8 +10cdc +10ce0 +10ce4 +10ce8 +10cec +10cf0 +10cf4 +10cf8 +10cfc +10d00 +10d04 +10d08 +10d0c +10d10 +10d14 +10d18 +10d1c +10d20 +10d24 +10d28 +10d2c +10d30 +10d34 +10d38 +10d3c +10d40 +10d44 +10d48 +10d4c +10d50 +10d54 +10d58 +10d5c +10d60 +10d64 +10d68 +10d6c +10d70 +10d74 +10d78 +10d7c +10d80 +10d84 +10d88 +10d8c +10d90 +10d94 +10d98 +10d9c +10da0 +10da4 +10da8 +10dac +10db0 +10db4 +10db8 +10dbc +10dc0 +10dc4 +10dc8 +10dcc +10dd0 +10dd4 +10dd8 +10ddc +10de0 +10de4 +10de8 +10dec +10df0 +10df4 +10df8 +10dfc +10e00 +10e04 +10e08 +10e0c +10e10 +10e14 +10e18 +10e1c +10e20 +10e24 +10e28 +10e2c +10e30 +10e34 +10e38 +10e3c +10e40 +10e44 +10e48 +10e4c +10e50 +10e54 +10e58 +10e5c +10e60 +10e64 +10e68 +10e6c +10e70 +10e74 +10e78 +10e7c +10e80 +10e84 +10e88 +10e8c +10e90 +10e94 +10e98 +10e9c +10ea0 +10ea4 +10ea8 +10eac +10eb0 +10eb4 +10eb8 +10ebc +10ec0 +10ec4 +10ec8 +10ecc +10ed0 +10ed4 +10ed8 +10edc +10ee0 +10ee4 +10ee8 +10eec +10ef0 +10ef4 +10ef8 +10f00 +10f04 +10f08 +10f0c +10f10 +10f14 +10f18 +10f1c +10f20 +10f24 +10f28 +10f2c +10f30 +10f34 +10f38 +10f3c +10f40 +10f44 +10f48 +10f4c +10f50 +10f54 +10f58 +10f5c +10f60 +10f64 +10f68 +10f6c +10f70 +10f74 +10f78 +10f7c +10f80 +10f84 +10f88 +10f8c +10f90 +10f94 +10f98 diff --git a/tests/test-progs/nops/src/generic_1/secret.c b/tests/test-progs/nops/src/generic_1/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..4491051c2badf300522d10d3fe66873d31c85954 --- /dev/null +++ b/tests/test-progs/nops/src/generic_1/secret.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020, French Institute for Research in Computer Science and + * Automation + * Author: Pierre-Yves Peneau <first.last@inria.fr> + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the <organization> nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 +#include "aes.h" + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + AESEncrypt(cipher, plain, key); + printf("%s\n", cipher); + + return 0; +} diff --git a/tests/test-progs/nops/src/generic_2/Makefile b/tests/test-progs/nops/src/generic_2/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..1c8cf18d9098d831e0e8e104cc2e383308e7cba5 --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 -fomit-frame-pointer +OUT=../../bin + +TARGET=secret_generic_2 + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c aes.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/generic_2/README b/tests/test-progs/nops/src/generic_2/README new file mode 100644 index 0000000000000000000000000000000000000000..d0accd59367d77d308a68532ce86a0ddc097936c --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/README @@ -0,0 +1 @@ +Use gem5.debug instead of gem5.opt for this use case diff --git a/tests/test-progs/nops/src/generic_2/aes.c b/tests/test-progs/nops/src/generic_2/aes.c new file mode 100644 index 0000000000000000000000000000000000000000..96088f23108b9f6dc66972abfdfdfb4088856a85 --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/aes.c @@ -0,0 +1,417 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + +#include "aes.h" + +//---------------------------------------------------------- +// AES128 encryption +//---------------------------------------------------------- +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + +//---------------------------------------------------------- +// AES Round functions +//---------------------------------------------------------- +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +//---------------------------------------------------------- +// Génération de clé +//---------------------------------------------------------- +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE],int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = + sboxtab[column[0]] ^ rcon[round-1] ^ keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey(unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + +//---------------------------------------------------------- +// Other useful functions +//---------------------------------------------------------- +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message[], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey(unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0]= gmul(column_tmp[0],2) ^ gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[1],3); + column[1]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ gmul(column_tmp[3],1); + column[2]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ gmul(column_tmp[3],3); + column[3]= gmul(column_tmp[0],3) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +//---------------------------------------------------------- +// Tables +//---------------------------------------------------------- +unsigned char trigger_sel = 1; + +const unsigned char rcon [10]={0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, + 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, + 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, + 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, + 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, + 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, + 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, + 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, + 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, + 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, + 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, + 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, + 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, + 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }; diff --git a/tests/test-progs/nops/src/generic_2/aes.h b/tests/test-progs/nops/src/generic_2/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..9239b7775e2136a0c25be7bff8280bb49f412bbe --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/aes.h @@ -0,0 +1,52 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + + + +#ifndef AES_H +#define AES_H + +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + +#endif diff --git a/tests/test-progs/nops/src/generic_2/nops.txt b/tests/test-progs/nops/src/generic_2/nops.txt new file mode 100644 index 0000000000000000000000000000000000000000..8918790d03d91c16eddea84eca86fed03a9a9a75 --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/nops.txt @@ -0,0 +1,7620 @@ +# Entry point +1059c 1 +# Skip AESEncrypt() +1059c s:1 +# From the start of printf to the end (bx lr to jump to main()) +# r0 is prepared +# We nop only once since the second execution is used to print the key +17c50 s:1 +17c54 s:1 +17c58 s:1 +17c5c s:1 +17c60 s:1 +17c64 s:1 +17c68 s:1 +17c6c s:1 +17c70 s:1 +17c74 s:1 +17c78 s:1 +17c7c s:1 +17c80 s:1 +17c84 s:1 +17c88 s:1 +17c8c s:1 +17c90 s:1 +17c94 s:1 +# +# Then in main(), we skip until AESEncrypt() to prepare r2 +# +# From 105b0 to 10604 to move key in r2 to r1 +105b0 +105b4 +105b8 +105bc +105c0 +105c4 +105c8 +105cc +105d0 +105d4 +105d8 +105dc +105e0 +105e4 +105e8 +105ec +105f0 +105f4 +105f8 +105fc +10600 +10604 +# +# Then huge skip to <_IO_printf> to retrieve the key +# +1060c +10610 +10614 +10618 +1061c +10620 +10624 +10628 +1062c +10630 +10634 +10638 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +1067c +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +106a0 +106a4 +106a8 +106ac +106b0 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +106e4 +106e8 +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +1072c +10730 +10734 +10738 +1073c +10740 +10744 +10748 +1074c +10750 +10754 +10758 +1075c +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +10964 +10968 +1096c +10970 +10974 +10978 +1097c +10980 +10984 +10988 +1098c +10990 +10994 +10998 +1099c +109a0 +109a4 +109a8 +109ac +109b0 +109b4 +109b8 +109bc +109c0 +109c4 +109c8 +109cc +109d0 +109d4 +109d8 +109dc +109e0 +109e4 +109e8 +109ec +109f0 +109f4 +109f8 +109fc +10a00 +10a04 +10a08 +10a0c +10a10 +10a14 +10a18 +10a1c +10a20 +10a24 +10a28 +10a2c +10a30 +10a34 +10a38 +10a3c +10a40 +10a44 +10a48 +10a4c +10a50 +10a54 +10a58 +10a5c +10a60 +10a64 +10a68 +10a6c +10a70 +10a74 +10a78 +10a7c +10a80 +10a84 +10a88 +10a8c +10a90 +10a94 +10a98 +10a9c +10aa0 +10aa4 +10aa8 +10aac +10ab0 +10ab4 +10ab8 +10abc +10ac0 +10ac4 +10ac8 +10acc +10ad0 +10ad4 +10ad8 +10adc +10ae0 +10ae4 +10ae8 +10aec +10af0 +10af4 +10af8 +10afc +10b00 +10b04 +10b08 +10b0c +10b10 +10b14 +10b18 +10b1c +10b20 +10b24 +10b28 +10b2c +10b30 +10b34 +10b38 +10b3c +10b40 +10b44 +10b48 +10b4c +10b50 +10b54 +10b58 +10b5c +10b60 +10b64 +10b68 +10b6c +10b70 +10b74 +10b78 +10b7c +10b80 +10b84 +10b88 +10b8c +10b90 +10b94 +10b98 +10b9c +10ba0 +10ba4 +10ba8 +10bac +10bb0 +10bb4 +10bb8 +10bbc +10bc0 +10bc4 +10bc8 +10bcc +10bd0 +10bd4 +10bd8 +10bdc +10be0 +10be4 +10be8 +10bec +10bf0 +10bf4 +10bf8 +10bfc +10c00 +10c04 +10c08 +10c0c +10c10 +10c14 +10c18 +10c1c +10c20 +10c24 +10c28 +10c2c +10c30 +10c34 +10c38 +10c3c +10c40 +10c44 +10c48 +10c4c +10c50 +10c54 +10c58 +10c5c +10c60 +10c64 +10c68 +10c6c +10c70 +10c74 +10c78 +10c7c +10c80 +10c84 +10c88 +10c8c +10c90 +10c94 +10c98 +10c9c +10ca0 +10ca4 +10ca8 +10cac +10cb0 +10cb4 +10cb8 +10cbc +10cc0 +10cc4 +10cc8 +10ccc +10cd0 +10cd4 +10cd8 +10cdc +10ce0 +10ce4 +10ce8 +10cec +10cf0 +10cf4 +10cf8 +10cfc +10d00 +10d04 +10d08 +10d0c +10d10 +10d14 +10d18 +10d1c +10d20 +10d24 +10d28 +10d2c +10d30 +10d34 +10d38 +10d3c +10d40 +10d44 +10d48 +10d4c +10d50 +10d54 +10d58 +10d5c +10d60 +10d64 +10d68 +10d6c +10d70 +10d74 +10d78 +10d7c +10d80 +10d84 +10d88 +10d8c +10d90 +10d94 +10d98 +10d9c +10da0 +10da4 +10da8 +10dac +10db0 +10db4 +10db8 +10dbc +10dc0 +10dc4 +10dc8 +10dcc +10dd0 +10dd4 +10dd8 +10ddc +10de0 +10de4 +10de8 +10dec +10df0 +10df4 +10df8 +10dfc +10e00 +10e04 +10e08 +10e0c +10e10 +10e14 +10e18 +10e1c +10e20 +10e24 +10e28 +10e2c +10e30 +10e34 +10e38 +10e3c +10e40 +10e44 +10e48 +10e4c +10e50 +10e54 +10e58 +10e5c +10e60 +10e64 +10e68 +10e6c +10e70 +10e74 +10e78 +10e7c +10e80 +10e84 +10e88 +10e8c +10e90 +10e94 +10e98 +10e9c +10ea0 +10ea4 +10ea8 +10eac +10eb0 +10eb4 +10eb8 +10ebc +10ec0 +10ec4 +10ec8 +10ecc +10ed0 +10ed4 +10ed8 +10edc +10ee0 +10ee4 +10ee8 +10eec +10ef0 +10ef4 +10ef8 +10efc +10f00 +10f04 +10f08 +10f0c +10f10 +10f14 +10f18 +10f1c +10f20 +10f24 +10f28 +10f2c +10f30 +10f34 +10f38 +10f3c +10f40 +10f44 +10f48 +10f4c +10f50 +10f54 +10f58 +10f5c +10f60 +10f64 +10f68 +10f6c +10f70 +10f74 +10f78 +10f7c +10f80 +10f84 +10f88 +10f8c +10f90 +10f94 +10f98 +10f9c +10fa0 +10fa4 +10fa8 +10fac +10fb0 +10fb4 +10fb8 +10fbc +10fc0 +10fc4 +10fc8 +10fcc +10fd0 +10fd4 +10fd8 +10fdc +10fe0 +10fe4 +10fe8 +10fec +10ff0 +10ff4 +10ff8 +10ffc +11000 +11004 +11008 +1100c +11010 +11014 +11018 +1101c +11020 +11024 +11028 +1102c +11030 +11034 +11038 +1103c +11040 +11044 +11048 +1104c +11050 +11054 +11058 +1105c +11060 +11064 +11068 +1106c +11070 +11074 +11078 +1107c +11080 +11084 +11088 +1108c +11090 +11094 +11098 +1109c +110a0 +110a4 +110a8 +110ac +110b0 +110b4 +110b8 +110bc +110c0 +110c4 +110c8 +110cc +110d0 +110d4 +110d8 +110dc +110e0 +110e4 +110e8 +110ec +110f0 +110f4 +110f8 +110fc +11100 +11104 +11108 +1110c +11110 +11114 +11118 +1111c +11120 +11124 +11128 +1112c +11130 +11134 +11138 +1113c +11140 +11144 +11148 +1114c +11150 +11154 +11158 +1115c +11160 +11164 +11168 +1116c +11170 +11174 +11178 +1117c +11180 +11184 +11188 +1118c +11190 +11194 +11198 +1119c +111a0 +111a4 +111a8 +111ac +111b0 +111b4 +111b8 +111bc +111c0 +111c4 +111c8 +111cc +111d0 +111d4 +111d8 +111dc +111e0 +111e4 +111e8 +111ec +111f0 +111f4 +111f8 +111fc +11200 +11204 +11208 +1120c +11210 +11214 +11218 +1121c +11220 +11224 +11228 +1122c +11230 +11234 +11238 +1123c +11240 +11244 +11248 +1124c +11250 +11254 +11258 +1125c +11260 +11264 +11268 +1126c +11270 +11274 +11278 +1127c +11280 +11284 +11288 +1128c +11290 +11294 +11298 +1129c +112a0 +112a4 +112a8 +112ac +112b0 +112b4 +112b8 +112bc +112c0 +112c4 +112c8 +112cc +112d0 +112d4 +112d8 +112dc +112e0 +112e4 +112e8 +112ec +112f0 +112f4 +112f8 +112fc +11300 +11304 +11308 +1130c +11310 +11314 +11318 +1131c +11320 +11324 +11328 +1132c +11330 +11334 +11338 +1133c +11340 +11344 +11348 +1134c +11350 +11354 +11358 +1135c +11360 +11364 +11368 +1136c +11370 +11374 +11378 +1137c +11380 +11384 +11388 +1138c +11390 +11394 +11398 +1139c +113a0 +113a4 +113a8 +113ac +113b0 +113b4 +113b8 +113bc +113c0 +113c4 +113c8 +113cc +113d0 +113d4 +113d8 +113dc +113e0 +113e4 +113e8 +113ec +113f0 +113f4 +113f8 +113fc +11400 +11404 +11408 +1140c +11410 +11414 +11418 +1141c +11420 +11424 +11428 +1142c +11430 +11434 +11438 +1143c +11440 +11444 +11448 +1144c +11450 +11454 +11458 +1145c +11460 +11464 +11468 +1146c +11470 +11474 +11478 +1147c +11480 +11484 +11488 +1148c +11490 +11494 +11498 +1149c +114a0 +114a4 +114a8 +114ac +114b0 +114b4 +114b8 +114bc +114c0 +114c4 +114c8 +114cc +114d0 +114d4 +114d8 +114dc +114e0 +114e4 +114e8 +114ec +114f0 +114f4 +114f8 +114fc +11500 +11504 +11508 +1150c +11510 +11514 +11518 +1151c +11520 +11524 +11528 +1152c +11530 +11534 +11538 +1153c +11540 +11544 +11548 +1154c +11550 +11554 +11558 +1155c +11560 +11564 +11568 +1156c +11570 +11574 +11578 +1157c +11580 +11584 +11588 +1158c +11590 +11594 +11598 +1159c +115a0 +115a4 +115a8 +115ac +115b0 +115b4 +115b8 +115bc +115c0 +115c4 +115c8 +115cc +115d0 +115d4 +115d8 +115dc +115e0 +115e4 +115e8 +115ec +115f0 +115f4 +115f8 +115fc +11600 +11604 +11608 +1160c +11610 +11614 +11618 +1161c +11620 +11624 +11628 +1162c +11630 +11634 +11638 +1163c +11640 +11644 +11648 +1164c +11650 +11654 +11658 +1165c +11660 +11664 +11668 +1166c +11670 +11674 +11678 +1167c +11680 +11684 +11688 +1168c +11690 +11694 +11698 +1169c +116a0 +116a4 +116a8 +116ac +116b0 +116b4 +116b8 +116bc +116c0 +116c4 +116c8 +116cc +116d0 +116d4 +116d8 +116dc +116e0 +116e4 +116e8 +116ec +116f0 +116f4 +116f8 +116fc +11700 +11704 +11708 +1170c +11710 +11714 +11718 +1171c +11720 +11724 +11728 +1172c +11730 +11734 +11738 +1173c +11740 +11744 +11748 +1174c +11750 +11754 +11758 +1175c +11760 +11764 +11768 +1176c +11770 +11774 +11778 +1177c +11780 +11784 +11788 +1178c +11790 +11794 +11798 +1179c +117a0 +117a4 +117a8 +117ac +117b0 +117b4 +117b8 +117bc +117c0 +117c4 +117c8 +117cc +117d0 +117d4 +117d8 +117dc +117e0 +117e4 +117e8 +117ec +117f0 +117f4 +117f8 +117fc +11800 +11804 +11808 +1180c +11810 +11814 +11818 +1181c +11820 +11824 +11828 +1182c +11830 +11834 +11838 +1183c +11840 +11844 +11848 +1184c +11850 +11854 +11858 +1185c +11860 +11864 +11868 +1186c +11870 +11874 +11878 +1187c +11880 +11884 +11888 +1188c +11890 +11894 +11898 +1189c +118a0 +118a4 +118a8 +118ac +118b0 +118b4 +118b8 +118bc +118c0 +118c4 +118c8 +118cc +118d0 +118d4 +118d8 +118dc +118e0 +118e4 +118e8 +118ec +118f0 +118f4 +118f8 +118fc +11900 +11904 +11908 +1190c +11910 +11914 +11918 +1191c +11920 +11924 +11928 +1192c +11930 +11934 +11938 +1193c +11940 +11944 +11948 +1194c +11950 +11954 +11958 +1195c +11960 +11964 +11968 +1196c +11970 +11974 +11978 +1197c +11980 +11984 +11988 +1198c +11990 +11994 +11998 +1199c +119a0 +119a4 +119a8 +119ac +119b0 +119b4 +119b8 +119bc +119c0 +119c4 +119c8 +119cc +119d0 +119d4 +119d8 +119dc +119e0 +119e4 +119e8 +119ec +119f0 +119f4 +119f8 +119fc +11a00 +11a04 +11a08 +11a0c +11a10 +11a14 +11a18 +11a1c +11a20 +11a24 +11a28 +11a2c +11a30 +11a34 +11a38 +11a3c +11a40 +11a44 +11a48 +11a4c +11a50 +11a54 +11a58 +11a5c +11a60 +11a64 +11a68 +11a6c +11a70 +11a74 +11a78 +11a7c +11a80 +11a84 +11a88 +11a8c +11a90 +11a94 +11a98 +11a9c +11aa0 +11aa4 +11aa8 +11aac +11ab0 +11ab4 +11ab8 +11abc +11ac0 +11ac4 +11ac8 +11acc +11ad0 +11ad4 +11ad8 +11adc +11ae0 +11ae4 +11ae8 +11aec +11af0 +11af4 +11af8 +11afc +11b00 +11b04 +11b08 +11b0c +11b10 +11b14 +11b18 +11b1c +11b20 +11b24 +11b28 +11b2c +11b30 +11b34 +11b38 +11b3c +11b40 +11b44 +11b48 +11b4c +11b50 +11b54 +11b58 +11b5c +11b60 +11b64 +11b68 +11b6c +11b70 +11b74 +11b78 +11b7c +11b80 +11b84 +11b88 +11b8c +11b90 +11b94 +11b98 +11b9c +11ba0 +11ba4 +11ba8 +11bac +11bb0 +11bb4 +11bb8 +11bbc +11bc0 +11bc4 +11bc8 +11bcc +11bd0 +11bd4 +11bd8 +11bdc +11be0 +11be4 +11be8 +11bec +11bf0 +11bf4 +11bf8 +11bfc +11c00 +11c04 +11c08 +11c0c +11c10 +11c14 +11c18 +11c1c +11c20 +11c24 +11c28 +11c2c +11c30 +11c34 +11c38 +11c3c +11c40 +11c44 +11c48 +11c4c +11c50 +11c54 +11c58 +11c5c +11c60 +11c64 +11c68 +11c6c +11c70 +11c74 +11c78 +11c7c +11c80 +11c84 +11c88 +11c8c +11c90 +11c94 +11c98 +11c9c +11ca0 +11ca4 +11ca8 +11cac +11cb0 +11cb4 +11cb8 +11cbc +11cc0 +11cc4 +11cc8 +11ccc +11cd0 +11cd4 +11cd8 +11cdc +11ce0 +11ce4 +11ce8 +11cec +11cf0 +11cf4 +11cf8 +11cfc +11d00 s:1 +11d04 s:1 +11d08 +11d0c +11d10 +11d14 +11d18 +11d1c +11d20 +11d24 +11d28 +11d2c +11d30 +11d34 +11d38 +11d3c +11d40 +11d44 +11d48 +11d4c +11d50 +11d54 +11d58 +11d5c +11d60 +11d64 +11d68 +11d6c +11d70 +11d74 +11d78 +11d7c +11d80 +11d84 +11d88 +11d8c +11d90 +11d94 +11d98 +11d9c +11da0 +11da4 +11da8 +11dac +11db0 +11db4 +11db8 +11dbc +11dc0 +11dc4 +11dc8 +11dcc +11dd0 +11dd4 +11dd8 +11ddc +11de0 +11de4 +11de8 +11dec +11df0 +11df4 +11df8 +11dfc +11e00 +11e04 +11e08 +11e0c +11e10 +11e14 +11e18 +11e1c +11e20 +11e24 +11e28 +11e2c +11e30 +11e34 +11e38 +11e3c +11e40 +11e44 +11e48 +11e4c +11e50 +11e54 +11e58 +11e5c +11e60 +11e64 +11e68 +11e6c +11e70 +11e74 +11e78 +11e7c +11e80 +11e84 +11e88 +11e8c +11e90 +11e94 +11e98 +11e9c +11ea0 +11ea4 +11ea8 +11eac +11eb0 +11eb4 +11eb8 +11ebc +11ec0 +11ec4 +11ec8 +11ecc +11ed0 +11ed4 +11ed8 +11edc +11ee0 +11ee4 +11ee8 +11eec +11ef0 +11ef4 +11ef8 +11efc +11f00 +11f04 +11f08 +11f0c +11f10 +11f14 +11f18 +11f1c +11f20 +11f24 +11f28 +11f2c +11f30 +11f34 +11f38 +11f3c +11f40 +11f44 +11f48 +11f4c +11f50 +11f54 +11f58 +11f5c +11f60 +11f64 +11f68 +11f6c +11f70 +11f74 +11f78 +11f7c +11f80 +11f84 +11f88 +11f8c +11f90 +11f94 +11f98 +11f9c +11fa0 +11fa4 +11fa8 +11fac +11fb0 +11fb4 +11fb8 +11fbc +11fc0 +11fc4 +11fc8 +11fcc +11fd0 +11fd4 +11fd8 +11fdc +11fe0 +11fe4 +11fe8 +11fec +11ff0 +11ff4 +11ff8 +11ffc +12000 +12004 +12008 +1200c +12010 +12014 +12018 +1201c +12020 +12024 +12028 +1202c +12030 +12034 +12038 +1203c +12040 +12044 +12048 +1204c +12050 +12054 +12058 +1205c +12060 +12064 +12068 +1206c +12070 +12074 +12078 +1207c +12080 +12084 +12088 +1208c +12090 +12094 +12098 +1209c +120a0 +120a4 +120a8 +120ac +120b0 +120b4 +120b8 +120bc +120c0 +120c4 +120c8 +120cc +120d0 +120d4 +120d8 +120dc +120e0 +120e4 +120e8 +120ec +120f0 +120f4 +120f8 +120fc +12100 +12104 +12108 +1210c +12110 +12114 +12118 +1211c +12120 +12124 +12128 +1212c +12130 +12134 +12138 +1213c +12140 +12144 +12148 +1214c +12150 +12154 +12158 +1215c +12160 +12164 +12168 +1216c +12170 +12174 +12178 +1217c +12180 +12184 +12188 +1218c +12190 +12194 +12198 +1219c +121a0 +121a4 +121a8 +121ac +121b0 +121b4 +121b8 +121bc +121c0 +121c4 +121c8 +121cc +121d0 +121d4 +121d8 +121dc +121e0 +121e4 +121e8 +121ec +121f0 +121f4 +121f8 +121fc +12200 +12204 +12208 +1220c +12210 +12214 +12218 +1221c +12220 +12224 +12228 +1222c +12230 +12234 +12238 +1223c +12240 +12244 +12248 +1224c +12250 +12254 +12258 +1225c +12260 +12264 +12268 +1226c +12270 +12274 +12278 +1227c +12280 +12284 +12288 +1228c +12290 +12294 +12298 +1229c +122a0 +122a4 +122a8 +122ac +122b0 +122b4 +122b8 +122bc +122c0 +122c4 +122c8 +122cc +122d0 +122d4 +122d8 +122dc +122e0 +122e4 +122e8 +122ec +122f0 +122f4 +122f8 +122fc +12300 +12304 +12308 +1230c +12310 +12314 +12318 +1231c +12320 +12324 +12328 +1232c +12330 +12334 +12338 +1233c +12340 +12344 +12348 +1234c +12350 +12354 +12358 +1235c +12360 +12364 +12368 +1236c +12370 +12374 +12378 +1237c +12380 +12384 +12388 +1238c +12390 +12394 +12398 +1239c +123a0 +123a4 +123a8 +123ac +123b0 +123b4 +123b8 +123bc +123c0 +123c4 +123c8 +123cc +123d0 +123d4 +123d8 +123dc +123e0 +123e4 +123e8 +123ec +123f0 +123f4 +123f8 +123fc +12400 +12404 +12408 +1240c +12410 +12414 +12418 +1241c +12420 +12424 +12428 +1242c +12430 +12434 +12438 +1243c +12440 +12444 +12448 +1244c +12450 +12454 +12458 +1245c +12460 +12464 +12468 +1246c +12470 +12474 +12478 +1247c +12480 +12484 +12488 +1248c +12490 +12494 +12498 +1249c +124a0 +124a4 +124a8 +124ac +124b0 +124b4 +124b8 +124bc +124c0 +124c4 +124c8 +124cc +124d0 +124d4 +124d8 +124dc +124e0 +124e4 +124e8 +124ec +124f0 +124f4 +124f8 +124fc +12500 +12504 +12508 +1250c +12510 +12514 +12518 +1251c +12520 +12524 +12528 +1252c +12530 +12534 +12538 +1253c +12540 +12544 +12548 +1254c +12550 +12554 +12558 +1255c +12560 +12564 +12568 +1256c +12570 +12574 +12578 +1257c +12580 +12584 +12588 +1258c +12590 +12594 +12598 +1259c +125a0 +125a4 +125a8 +125ac +125b0 +125b4 +125b8 +125bc +125c0 +125c4 +125c8 +125cc +125d0 +125d4 +125d8 +125dc +125e0 +125e4 +125e8 +125ec +125f0 +125f4 +125f8 +125fc +12600 +12604 +12608 +1260c +12610 +12614 +12618 +1261c +12620 +12624 +12628 +1262c +12630 +12634 +12638 +1263c +12640 +12644 +12648 +1264c +12650 +12654 +12658 +1265c +12660 +12664 +12668 +1266c +12670 +12674 +12678 +1267c +12680 +12684 +12688 +1268c +12690 +12694 +12698 +1269c +126a0 +126a4 +126a8 +126ac +126b0 +126b4 +126b8 +126bc +126c0 +126c4 +126c8 +126cc +126d0 +126d4 +126d8 +126dc +126e0 +126e4 +126e8 +126ec +126f0 +126f4 +126f8 +126fc +12700 +12704 +12708 +1270c +12710 +12714 +12718 +1271c +12720 +12724 +12728 +1272c +12730 +12734 +12738 +1273c +12740 +12744 +12748 +1274c +12750 +12754 +12758 +1275c +12760 +12764 +12768 +1276c +12770 +12774 +12778 +1277c +12780 +12784 +12788 +1278c +12790 +12794 +12798 +1279c +127a0 +127a4 +127a8 +127ac +127b0 +127b4 +127b8 +127bc +127c0 +127c4 +127c8 +127cc +127d0 +127d4 +127d8 +127dc +127e0 +127e4 +127e8 +127ec +127f0 +127f4 +127f8 +127fc +12800 +12804 +12808 +1280c +12810 +12814 +12818 +1281c +12820 +12824 +12828 +1282c +12830 +12834 +12838 +1283c +12840 +12844 +12848 +1284c +12850 +12854 +12858 +1285c +12860 +12864 +12868 +1286c +12870 +12874 +12878 +1287c +12880 +12884 +12888 +1288c +12890 +12894 +12898 +1289c +128a0 +128a4 +128a8 +128ac +128b0 +128b4 +128b8 +128bc +128c0 +128c4 +128c8 +128cc +128d0 +128d4 +128d8 +128dc +128e0 +128e4 +128e8 +128ec +128f0 +128f4 +128f8 +128fc +12900 +12904 +12908 +1290c +12910 +12914 +12918 +1291c +12920 +12924 +12928 +1292c +12930 +12934 +12938 +1293c +12940 +12944 +12948 +1294c +12950 +12954 +12958 +1295c +12960 +12964 +12968 +1296c +12970 +12974 +12978 +1297c +12980 +12984 +12988 +1298c +12990 +12994 +12998 +1299c +129a0 +129a4 +129a8 +129ac +129b0 +129b4 +129b8 +129bc +129c0 +129c4 +129c8 +129cc +129d0 +129d4 +129d8 +129dc +129e0 +129e4 +129e8 +129ec +129f0 +129f4 +129f8 +129fc +12a00 +12a04 +12a08 +12a0c +12a10 +12a14 +12a18 +12a1c +12a20 +12a24 +12a28 +12a2c +12a30 +12a34 +12a38 +12a3c +12a40 +12a44 +12a48 +12a4c +12a50 +12a54 +12a58 +12a5c +12a60 +12a64 +12a68 +12a6c +12a70 +12a74 +12a78 +12a7c +12a80 +12a84 +12a88 +12a8c +12a90 +12a94 +12a98 +12a9c +12aa0 +12aa4 +12aa8 +12aac +12ab0 +12ab4 +12ab8 +12abc +12ac0 +12ac4 +12ac8 +12acc +12ad0 +12ad4 +12ad8 +12adc +12ae0 +12ae4 +12ae8 +12aec +12af0 +12af4 +12af8 +12afc +12b00 +12b04 +12b08 +12b0c +12b10 +12b14 +12b18 +12b1c +12b20 +12b24 +12b28 +12b2c +12b30 +12b34 +12b38 +12b3c +12b40 +12b44 +12b48 +12b4c +12b50 +12b54 +12b58 +12b5c +12b60 +12b64 +12b68 +12b6c +12b70 +12b74 +12b78 +12b7c +12b80 +12b84 +12b88 +12b8c +12b90 +12b94 +12b98 +12b9c +12ba0 +12ba4 +12ba8 +12bac +12bb0 +12bb4 +12bb8 +12bbc +12bc0 +12bc4 +12bc8 +12bcc +12bd0 +12bd4 +12bd8 +12bdc +12be0 +12be4 +12be8 +12bec +12bf0 +12bf4 +12bf8 +12bfc +12c00 +12c04 +12c08 +12c0c +12c10 +12c14 +12c18 +12c1c +12c20 +12c24 +12c28 +12c2c +12c30 +12c34 +12c38 +12c3c +12c40 +12c44 +12c48 +12c4c +12c50 +12c54 +12c58 +12c5c +12c60 +12c64 +12c68 +12c6c +12c70 +12c74 +12c78 +12c7c +12c80 +12c84 +12c88 +12c8c +12c90 +12c94 +12c98 +12c9c +12ca0 +12ca4 +12ca8 +12cac +12cb0 +12cb4 +12cb8 +12cbc +12cc0 +12cc4 +12cc8 +12ccc +12cd0 +12cd4 +12cd8 +12cdc +12ce0 +12ce4 +12ce8 +12cec +12cf0 +12cf4 +12cf8 +12cfc +12d00 +12d04 +12d08 +12d0c +12d10 +12d14 +12d18 +12d1c +12d20 +12d24 +12d28 +12d2c +12d30 +12d34 +12d38 +12d3c +12d40 +12d44 +12d48 +12d4c +12d50 +12d54 +12d58 +12d5c +12d60 +12d64 +12d68 +12d6c +12d70 +12d74 +12d78 +12d7c +12d80 +12d84 +12d88 +12d8c +12d90 +12d94 +12d98 +12d9c +12da0 +12da4 +12da8 +12dac +12db0 +12db4 +12db8 +12dbc +12dc0 +12dc4 +12dc8 +12dcc +12dd0 +12dd4 +12dd8 +12ddc +12de0 +12de4 +12de8 +12dec +12df0 +12df4 +12df8 +12dfc +12e00 +12e04 +12e08 +12e0c +12e10 +12e14 +12e18 +12e1c +12e20 +12e24 +12e28 +12e2c +12e30 +12e34 +12e38 +12e3c +12e40 +12e44 +12e48 +12e4c +12e50 +12e54 +12e58 +12e5c +12e60 +12e64 +12e68 +12e6c +12e70 +12e74 +12e78 +12e7c +12e80 +12e84 +12e88 +12e8c +12e90 +12e94 +12e98 +12e9c +12ea0 +12ea4 +12ea8 +12eac +12eb0 +12eb4 +12eb8 +12ebc +12ec0 +12ec4 +12ec8 +12ecc +12ed0 +12ed4 +12ed8 +12edc +12ee0 +12ee4 +12ee8 +12eec +12ef0 +12ef4 +12ef8 +12efc +12f00 +12f04 +12f08 +12f0c +12f10 +12f14 +12f18 +12f1c +12f20 +12f24 +12f28 +12f2c +12f30 +12f34 +12f38 +12f3c +12f40 +12f44 +12f48 +12f4c +12f50 +12f54 +12f58 +12f5c +12f60 +12f64 +12f68 +12f6c +12f70 +12f74 +12f78 +12f7c +12f80 +12f84 +12f88 +12f8c +12f90 +12f94 +12f98 +12f9c +12fa0 +12fa4 +12fa8 +12fac +12fb0 +12fb4 +12fb8 +12fbc +12fc0 +12fc4 +12fc8 +12fcc +12fd0 +12fd4 +12fd8 +12fdc +12fe0 +12fe4 +12fe8 +12fec +12ff0 +12ff4 +12ff8 +12ffc +13000 +13004 +13008 +1300c +13010 +13014 +13018 +1301c +13020 +13024 +13028 +1302c +13030 +13034 +13038 +1303c +13040 +13044 +13048 +1304c +13050 +13054 +13058 +1305c +13060 +13064 +13068 +1306c +13070 +13074 +13078 +1307c +13080 +13084 +13088 +1308c +13090 +13094 +13098 +1309c +130a0 +130a4 +130a8 +130ac +130b0 +130b4 +130b8 +130bc +130c0 +130c4 +130c8 +130cc +130d0 +130d4 +130d8 +130dc +130e0 +130e4 +130e8 +130ec +130f0 +130f4 +130f8 +130fc +13100 +13104 +13108 +1310c +13110 +13114 +13118 +1311c +13120 +13124 +13128 +1312c +13130 +13134 +13138 +1313c +13140 +13144 +13148 +1314c +13150 +13154 +13158 +1315c +13160 +13164 +13168 +1316c +13170 +13174 +13178 +1317c +13180 +13184 +13188 +1318c +13190 +13194 +13198 +1319c +131a0 +131a4 +131a8 +131ac +131b0 +131b4 +131b8 +131bc +131c0 +131c4 +131c8 +131cc +131d0 +131d4 +131d8 +131dc +131e0 +131e4 +131e8 +131ec +131f0 +131f4 +131f8 +131fc +13200 +13204 +13208 +1320c +13210 +13214 +13218 +1321c +13220 +13224 +13228 +1322c +13230 +13234 +13238 +1323c +13240 +13244 +13248 +1324c +13250 +13254 +13258 +1325c +13260 +13264 +13268 +1326c +13270 +13274 +13278 +1327c +13280 +13284 +13288 +1328c +13290 +13294 +13298 +1329c +132a0 +132a4 +132a8 +132ac +132b0 +132b4 +132b8 +132bc +132c0 +132c4 +132c8 +132cc +132d0 +132d4 +132d8 +132dc +132e0 +132e4 +132e8 +132ec +132f0 +132f4 +132f8 +132fc +13300 +13304 +13308 +1330c +13310 +13314 +13318 +1331c +13320 +13324 +13328 +1332c +13330 +13334 +13338 +1333c +13340 +13344 +13348 +1334c +13350 +13354 +13358 +1335c +13360 +13364 +13368 +1336c +13370 +13374 +13378 +1337c +13380 +13384 +13388 +1338c +13390 +13394 +13398 +1339c +133a0 +133a4 +133a8 +133ac +133b0 +133b4 +133b8 +133bc +133c0 +133c4 +133c8 +133cc +133d0 +133d4 +133d8 +133dc +133e0 +133e4 +133e8 +133ec +133f0 +133f4 +133f8 +133fc +13400 +13404 +13408 +1340c +13410 +13414 +13418 +1341c +13420 +13424 +13428 +1342c +13430 +13434 +13438 +1343c +13440 +13444 +13448 +1344c +13450 +13454 +13458 +1345c +13460 +13464 +13468 +1346c +13470 +13474 +13478 +1347c +13480 +13484 +13488 +1348c +13490 +13494 +13498 +1349c +134a0 +134a4 +134a8 +134ac +134b0 +134b4 +134b8 +134bc +134c0 +134c4 +134c8 +134cc +134d0 +134d4 +134d8 +134dc +134e0 +134e4 +134e8 +134ec +134f0 +134f4 +134f8 +134fc +13500 +13504 +13508 +1350c +13510 +13514 +13518 +1351c +13520 +13524 +13528 +1352c +13530 +13534 +13538 +1353c +13540 +13544 +13548 +1354c +13550 +13554 +13558 +1355c +13560 +13564 +13568 +1356c +13570 +13574 +13578 +1357c +13580 +13584 +13588 +1358c +13590 +13594 +13598 +1359c +135a0 +135a4 +135a8 +135ac +135b0 +135b4 +135b8 +135bc +135c0 +135c4 +135c8 +135cc +135d0 +135d4 +135d8 +135dc +135e0 +135e4 +135e8 +135ec +135f0 +135f4 +135f8 +135fc +13600 +13604 +13608 +1360c +13610 +13614 +13618 +1361c +13620 +13624 +13628 +1362c +13630 +13634 +13638 +1363c +13640 +13644 +13648 +1364c +13650 +13654 +13658 +1365c +13660 +13664 +13668 +1366c +13670 +13674 +13678 +1367c +13680 +13684 +13688 +1368c +13690 +13694 +13698 +1369c +136a0 +136a4 +136a8 +136ac +136b0 +136b4 +136b8 +136bc +136c0 +136c4 +136c8 +136cc +136d0 +136d4 +136d8 +136dc +136e0 +136e4 +136e8 +136ec +136f0 +136f4 +136f8 +136fc +13700 +13704 +13708 +1370c +13710 +13714 +13718 +1371c +13720 +13724 +13728 +1372c +13730 +13734 +13738 +1373c +13740 +13744 +13748 +1374c +13750 +13754 +13758 +1375c +13760 +13764 +13768 +1376c +13770 +13774 +13778 +1377c +13780 +13784 +13788 +1378c +13790 +13794 +13798 +1379c +137a0 +137a4 +137a8 +137ac +137b0 +137b4 +137b8 +137bc +137c0 +137c4 +137c8 +137cc +137d0 +137d4 +137d8 +137dc +137e0 +137e4 +137e8 +137ec +137f0 +137f4 +137f8 +137fc +13800 +13804 +13808 +1380c +13810 +13814 +13818 +1381c +13820 +13824 +13828 +1382c +13830 +13834 +13838 +1383c +13840 +13844 +13848 +1384c +13850 +13854 +13858 +1385c +13860 +13864 +13868 +1386c +13870 +13874 +13878 +1387c +13880 +13884 +13888 +1388c +13890 +13894 +13898 +1389c +138a0 +138a4 +138a8 +138ac +138b0 +138b4 +138b8 +138bc +138c0 +138c4 +138c8 +138cc +138d0 +138d4 +138d8 +138dc +138e0 +138e4 +138e8 +138ec +138f0 +138f4 +138f8 +138fc +13900 +13904 +13908 +1390c +13910 +13914 +13918 +1391c +13920 +13924 +13928 +1392c +13930 +13934 +13938 +1393c +13940 +13944 +13948 +1394c +13950 +13954 +13958 +1395c +13960 +13964 +13968 +1396c +13970 +13974 +13978 +1397c +13980 +13984 +13988 +1398c +13990 +13994 +13998 +1399c +139a0 +139a4 +139a8 +139ac +139b0 +139b4 +139b8 +139bc +139c0 +139c4 +139c8 +139cc +139d0 +139d4 +139d8 +139dc +139e0 +139e4 +139e8 +139ec +139f0 +139f4 +139f8 +139fc +13a00 +13a04 +13a08 +13a0c +13a10 +13a14 +13a18 +13a1c +13a20 +13a24 +13a28 +13a2c +13a30 +13a34 +13a38 +13a3c +13a40 +13a44 +13a48 +13a4c +13a50 +13a54 +13a58 +13a5c +13a60 +13a64 +13a68 +13a6c +13a70 +13a74 +13a78 +13a7c +13a80 +13a84 +13a88 +13a8c +13a90 +13a94 +13a98 +13a9c +13aa0 +13aa4 +13aa8 +13aac +13ab0 +13ab4 +13ab8 +13abc +13ac0 +13ac4 +13ac8 +13acc +13ad0 +13ad4 +13ad8 +13adc +13ae0 +13ae4 +13ae8 +13aec +13af0 +13af4 +13af8 +13afc +13b00 +13b04 +13b08 +13b0c +13b10 +13b14 +13b18 +13b1c +13b20 +13b24 +13b28 +13b2c +13b30 +13b34 +13b38 +13b3c +13b40 +13b44 +13b48 +13b4c +13b50 +13b54 +13b58 +13b5c +13b60 +13b64 +13b68 +13b6c +13b70 +13b74 +13b78 +13b7c +13b80 +13b84 +13b88 +13b8c +13b90 +13b94 +13b98 +13b9c +13ba0 +13ba4 +13ba8 +13bac +13bb0 +13bb4 +13bb8 +13bbc +13bc0 +13bc4 +13bc8 +13bcc +13bd0 +13bd4 +13bd8 +13bdc +13be0 +13be4 +13be8 +13bec +13bf0 +13bf4 +13bf8 +13bfc +13c00 +13c04 +13c08 +13c0c +13c10 +13c14 +13c18 +13c1c +13c20 +13c24 +13c28 +13c2c +13c30 +13c34 +13c38 +13c3c +13c40 +13c44 +13c48 +13c4c +13c50 +13c54 +13c58 +13c5c +13c60 +13c64 +13c68 +13c6c +13c70 +13c74 +13c78 +13c7c +13c80 +13c84 +13c88 +13c8c +13c90 +13c94 +13c98 +13c9c +13ca0 +13ca4 +13ca8 +13cac +13cb0 +13cb4 +13cb8 +13cbc +13cc0 +13cc4 +13cc8 +13ccc +13cd0 +13cd4 +13cd8 +13cdc +13ce0 +13ce4 +13ce8 +13cec +13cf0 +13cf4 +13cf8 +13cfc +13d00 +13d04 +13d08 +13d0c +13d10 +13d14 +13d18 +13d1c +13d20 +13d24 +13d28 +13d2c +13d30 +13d34 +13d38 +13d3c +13d40 +13d44 +13d48 +13d4c +13d50 +13d54 +13d58 +13d5c +13d60 +13d64 +13d68 +13d6c +13d70 +13d74 +13d78 +13d7c +13d80 +13d84 +13d88 +13d8c +13d90 +13d94 +13d98 +13d9c +13da0 +13da4 +13da8 +13dac +13db0 +13db4 +13db8 +13dbc +13dc0 +13dc4 +13dc8 +13dcc +13dd0 +13dd4 +13dd8 +13ddc +13de0 +13de4 +13de8 +13dec +13df0 +13df4 +13df8 +13dfc +13e00 +13e04 +13e08 +13e0c +13e10 +13e14 +13e18 +13e1c +13e20 +13e24 +13e28 +13e2c +13e30 +13e34 +13e38 +13e3c +13e40 +13e44 +13e48 +13e4c +13e50 +13e54 +13e58 +13e5c +13e60 +13e64 +13e68 +13e6c +13e70 +13e74 +13e78 +13e7c +13e80 +13e84 +13e88 +13e8c +13e90 +13e94 +13e98 +13e9c +13ea0 +13ea4 +13ea8 +13eac +13eb0 +13eb4 +13eb8 +13ebc +13ec0 +13ec4 +13ec8 +13ecc +13ed0 +13ed4 +13ed8 +13edc +13ee0 +13ee4 +13ee8 +13eec +13ef0 +13ef4 +13ef8 +13efc +13f00 +13f04 +13f08 +13f0c +13f10 +13f14 +13f18 +13f1c +13f20 +13f24 +13f28 +13f2c +13f30 +13f34 +13f38 +13f3c +13f40 +13f44 +13f48 +13f4c +13f50 +13f54 +13f58 +13f5c +13f60 +13f64 +13f68 +13f6c +13f70 +13f74 +13f78 +13f7c +13f80 +13f84 +13f88 +13f8c +13f90 +13f94 +13f98 +13f9c +13fa0 +13fa4 +13fa8 +13fac +13fb0 +13fb4 +13fb8 +13fbc +13fc0 +13fc4 +13fc8 +13fcc +13fd0 +13fd4 +13fd8 +13fdc +13fe0 +13fe4 +13fe8 +13fec +13ff0 +13ff4 +13ff8 +13ffc +14000 +14004 +14008 +1400c +14010 +14014 +14018 +1401c +14020 +14024 +14028 +1402c +14030 +14034 +14038 +1403c +14040 +14044 +14048 +1404c +14050 +14054 +14058 +1405c +14060 +14064 +14068 +1406c +14070 +14074 +14078 +1407c +14080 +14084 +14088 +1408c +14090 +14094 +14098 +1409c +140a0 +140a4 +140a8 +140ac +140b0 +140b4 +140b8 +140bc +140c0 +140c4 +140c8 +140cc +140d0 +140d4 +140d8 +140dc +140e0 +140e4 +140e8 +140ec +140f0 +140f4 +140f8 +140fc +14100 +14104 +14108 +1410c +14110 +14114 +14118 +1411c +14120 +14124 +14128 +1412c +14130 +14134 +14138 +1413c +14140 +14144 +14148 +1414c +14150 +14154 +14158 +1415c +14160 +14164 +14168 +1416c +14170 +14174 +14178 +1417c +14180 +14184 +14188 +1418c +14190 +14194 +14198 +1419c +141a0 +141a4 +141a8 +141ac +141b0 +141b4 +141b8 +141bc +141c0 +141c4 +141c8 +141cc +141d0 +141d4 +141d8 +141dc +141e0 +141e4 +141e8 +141ec +141f0 +141f4 +141f8 +141fc +14200 +14204 +14208 +1420c +14210 +14214 +14218 +1421c +14220 +14224 +14228 +1422c +14230 +14234 +14238 +1423c +14240 +14244 +14248 +1424c +14250 +14254 +14258 +1425c +14260 +14264 +14268 +1426c +14270 +14274 +14278 +1427c +14280 +14284 +14288 +1428c +14290 +14294 +14298 +1429c +142a0 +142a4 +142a8 +142ac +142b0 +142b4 +142b8 +142bc +142c0 +142c4 +142c8 +142cc +142d0 +142d4 +142d8 +142dc +142e0 +142e4 +142e8 +142ec +142f0 +142f4 +142f8 +142fc +14300 +14304 +14308 +1430c +14310 +14314 +14318 +1431c +14320 +14324 +14328 +1432c +14330 +14334 +14338 +1433c +14340 +14344 +14348 +1434c +14350 +14354 +14358 +1435c +14360 +14364 +14368 +1436c +14370 +14374 +14378 +1437c +14380 +14384 +14388 +1438c +14390 +14394 +14398 +1439c +143a0 +143a4 +143a8 +143ac +143b0 +143b4 +143b8 +143bc +143c0 +143c4 +143c8 +143cc +143d0 +143d4 +143d8 +143dc +143e0 +143e4 +143e8 +143ec +143f0 +143f4 +143f8 +143fc +14400 +14404 +14408 +1440c +14410 +14414 +14418 +1441c +14420 +14424 +14428 +1442c +14430 +14434 +14438 +1443c +14440 +14444 +14448 +1444c +14450 +14454 +14458 +1445c +14460 +14464 +14468 +1446c +14470 +14474 +14478 +1447c +14480 +14484 +14488 +1448c +14490 +14494 +14498 +1449c +144a0 +144a4 +144a8 +144ac +144b0 +144b4 +144b8 +144bc +144c0 +144c4 +144c8 +144cc +144d0 +144d4 +144d8 +144dc +144e0 +144e4 +144e8 +144ec +144f0 +144f4 +144f8 +144fc +14500 +14504 +14508 +1450c +14510 +14514 +14518 +1451c +14520 +14524 +14528 +1452c +14530 +14534 +14538 +1453c +14540 +14544 +14548 +1454c +14550 +14554 +14558 +1455c +14560 +14564 +14568 +1456c +14570 +14574 +14578 +1457c +14580 +14584 +14588 +1458c +14590 +14594 +14598 +1459c +145a0 +145a4 +145a8 +145ac +145b0 +145b4 +145b8 +145bc +145c0 +145c4 +145c8 +145cc +145d0 +145d4 +145d8 +145dc +145e0 +145e4 +145e8 +145ec +145f0 +145f4 +145f8 +145fc +14600 +14604 +14608 +1460c +14610 +14614 +14618 +1461c +14620 +14624 +14628 +1462c +14630 +14634 +14638 +1463c +14640 +14644 +14648 +1464c +14650 +14654 +14658 +1465c +14660 +14664 +14668 +1466c +14670 +14674 +14678 +1467c +14680 +14684 +14688 +1468c +14690 +14694 +14698 +1469c +146a0 +146a4 +146a8 +146ac +146b0 +146b4 +146b8 +146bc +146c0 +146c4 +146c8 +146cc +146d0 +146d4 +146d8 +146dc +146e0 +146e4 +146e8 +146ec +146f0 +146f4 +146f8 +146fc +14700 +14704 +14708 +1470c +14710 +14714 +14718 +1471c +14720 +14724 +14728 +1472c +14730 +14734 +14738 +1473c +14740 +14744 +14748 +1474c +14750 +14754 +14758 +1475c +14760 +14764 +14768 +1476c +14770 +14774 +14778 +1477c +14780 +14784 +14788 +1478c +14790 +14794 +14798 +1479c +147a0 +147a4 +147a8 +147ac +147b0 +147b4 +147b8 +147bc +147c0 +147c4 +147c8 +147cc +147d0 +147d4 +147d8 +147dc +147e0 +147e4 +147e8 +147ec +147f0 +147f4 +147f8 +147fc +14800 +14804 +14808 +1480c +14810 +14814 +14818 +1481c +14820 +14824 +14828 +1482c +14830 +14834 +14838 +1483c +14840 +14844 +14848 +1484c +14850 +14854 +14858 +1485c +14860 +14864 +14868 +1486c +14870 +14874 +14878 +1487c +14880 +14884 +14888 +1488c +14890 +14894 +14898 +1489c +148a0 +148a4 +148a8 +148ac +148b0 +148b4 +148b8 +148bc +148c0 +148c4 +148c8 +148cc +148d0 +148d4 +148d8 +148dc +148e0 +148e4 +148e8 +148ec +148f0 +148f4 +148f8 +148fc +14900 +14904 +14908 +1490c +14910 +14914 +14918 +1491c +14920 +14924 +14928 +1492c +14930 +14934 +14938 +1493c +14940 +14944 +14948 +1494c +14950 +14954 +14958 +1495c +14960 +14964 +14968 +1496c +14970 +14974 +14978 +1497c +14980 +14984 +14988 +1498c +14990 +14994 +14998 +1499c +149a0 +149a4 +149a8 +149ac +149b0 +149b4 +149b8 +149bc +149c0 +149c4 +149c8 +149cc +149d0 +149d4 +149d8 +149dc +149e0 +149e4 +149e8 +149ec +149f0 +149f4 +149f8 +149fc +14a00 +14a04 +14a08 +14a0c +14a10 +14a14 +14a18 +14a1c +14a20 +14a24 +14a28 +14a2c +14a30 +14a34 +14a38 +14a3c +14a40 +14a44 +14a48 +14a4c +14a50 +14a54 +14a58 +14a5c +14a60 +14a64 +14a68 +14a6c +14a70 +14a74 +14a78 +14a7c +14a80 +14a84 +14a88 +14a8c +14a90 +14a94 +14a98 +14a9c +14aa0 +14aa4 +14aa8 +14aac +14ab0 +14ab4 +14ab8 +14abc +14ac0 +14ac4 +14ac8 +14acc +14ad0 +14ad4 +14ad8 +14adc +14ae0 +14ae4 +14ae8 +14aec +14af0 +14af4 +14af8 +14afc +14b00 +14b04 +14b08 +14b0c +14b10 +14b14 +14b18 +14b1c +14b20 +14b24 +14b28 +14b2c +14b30 +14b34 +14b38 +14b3c +14b40 +14b44 +14b48 +14b4c +14b50 +14b54 +14b58 +14b5c +14b60 +14b64 +14b68 +14b6c +14b70 +14b74 +14b78 +14b7c +14b80 +14b84 +14b88 +14b8c +14b90 +14b94 +14b98 +14b9c +14ba0 +14ba4 +14ba8 +14bac +14bb0 +14bb4 +14bb8 +14bbc +14bc0 +14bc4 +14bc8 +14bcc +14bd0 +14bd4 +14bd8 +14bdc +14be0 +14be4 +14be8 +14bec +14bf0 +14bf4 +14bf8 +14bfc +14c00 +14c04 +14c08 +14c0c +14c10 +14c14 +14c18 +14c1c +14c20 +14c24 +14c28 +14c2c +14c30 +14c34 +14c38 +14c3c +14c40 +14c44 +14c48 +14c4c +14c50 +14c54 +14c58 +14c5c +14c60 +14c64 +14c68 +14c6c +14c70 +14c74 +14c78 +14c7c +14c80 +14c84 +14c88 +14c8c +14c90 +14c94 +14c98 +14c9c +14ca0 +14ca4 +14ca8 +14cac +14cb0 +14cb4 +14cb8 +14cbc +14cc0 +14cc4 +14cc8 +14ccc +14cd0 +14cd4 +14cd8 +14cdc +14ce0 +14ce4 +14ce8 +14cec +14cf0 +14cf4 +14cf8 +14cfc +14d00 +14d04 +14d08 +14d0c +14d10 +14d14 +14d18 +14d1c +14d20 +14d24 +14d28 +14d2c +14d30 +14d34 +14d38 +14d3c +14d40 +14d44 +14d48 +14d4c +14d50 +14d54 +14d58 +14d5c +14d60 +14d64 +14d68 +14d6c +14d70 +14d74 +14d78 +14d7c +14d80 +14d84 +14d88 +14d8c +14d90 +14d94 +14d98 +14d9c +14da0 +14da4 +14da8 +14dac +14db0 +14db4 +14db8 +14dbc +14dc0 +14dc4 +14dc8 +14dcc +14dd0 +14dd4 +14dd8 +14ddc +14de0 +14de4 +14de8 +14dec +14df0 +14df4 +14df8 +14dfc +14e00 +14e04 +14e08 +14e0c +14e10 +14e14 +14e18 +14e1c +14e20 +14e24 +14e28 +14e2c +14e30 +14e34 +14e38 +14e3c +14e40 +14e44 +14e48 +14e4c +14e50 +14e54 +14e58 +14e5c +14e60 +14e64 +14e68 +14e6c +14e70 +14e74 +14e78 +14e7c +14e80 +14e84 +14e88 +14e8c +14e90 +14e94 +14e98 +14e9c +14ea0 +14ea4 +14ea8 +14eac +14eb0 +14eb4 +14eb8 +14ebc +14ec0 +14ec4 +14ec8 +14ecc +14ed0 +14ed4 +14ed8 +14edc +14ee0 +14ee4 +14ee8 +14eec +14ef0 +14ef4 +14ef8 +14efc +14f00 +14f04 +14f08 +14f0c +14f10 +14f14 +14f18 +14f1c +14f20 +14f24 +14f28 +14f2c +14f30 +14f34 +14f38 +14f3c +14f40 +14f44 +14f48 +14f4c +14f50 +14f54 +14f58 +14f5c +14f60 +14f64 +14f68 +14f6c +14f70 +14f74 +14f78 +14f7c +14f80 +14f84 +14f88 +14f8c +14f90 +14f94 +14f98 +14f9c +14fa0 +14fa4 +14fa8 +14fac +14fb0 +14fb4 +14fb8 +14fbc +14fc0 +14fc4 +14fc8 +14fcc +14fd0 +14fd4 +14fd8 +14fdc +14fe0 +14fe4 +14fe8 +14fec +14ff0 +14ff4 +14ff8 +14ffc +15000 +15004 +15008 +1500c +15010 +15014 +15018 +1501c +15020 +15024 +15028 +1502c +15030 +15034 +15038 +1503c +15040 +15044 +15048 +1504c +15050 +15054 +15058 +1505c +15060 +15064 +15068 +1506c +15070 +15074 +15078 +1507c +15080 +15084 +15088 +1508c +15090 +15094 +15098 +1509c +150a0 +150a4 +150a8 +150ac +150b0 +150b4 +150b8 +150bc +150c0 +150c4 +150c8 +150cc +150d0 +150d4 +150d8 +150dc +150e0 +150e4 +150e8 +150ec +150f0 +150f4 +150f8 +150fc +15100 +15104 +15108 +1510c +15110 +15114 +15118 +1511c +15120 +15124 +15128 +1512c +15130 +15134 +15138 +1513c +15140 +15144 +15148 +1514c +15150 +15154 +15158 +1515c +15160 +15164 +15168 +1516c +15170 +15174 +15178 +1517c +15180 +15184 +15188 +1518c +15190 +15194 +15198 +1519c +151a0 +151a4 +151a8 +151ac +151b0 +151b4 +151b8 +151bc +151c0 +151c4 +151c8 +151cc +151d0 +151d4 +151d8 +151dc +151e0 +151e4 +151e8 +151ec +151f0 +151f4 +151f8 +151fc +15200 +15204 +15208 +1520c +15210 +15214 +15218 +1521c +15220 +15224 +15228 +1522c +15230 +15234 +15238 +1523c +15240 +15244 +15248 +1524c +15250 +15254 +15258 +1525c +15260 +15264 +15268 +1526c +15270 +15274 +15278 +1527c +15280 +15284 +15288 +1528c +15290 +15294 +15298 +1529c +152a0 +152a4 +152a8 +152ac +152b0 +152b4 +152b8 +152bc +152c0 +152c4 +152c8 +152cc +152d0 +152d4 +152d8 +152dc +152e0 +152e4 +152e8 +152ec +152f0 +152f4 +152f8 +152fc +15300 +15304 +15308 +1530c +15310 +15314 +15318 +1531c +15320 +15324 +15328 +1532c +15330 +15334 +15338 +1533c +15340 +15344 +15348 +1534c +15350 +15354 +15358 +1535c +15360 +15364 +15368 +1536c +15370 +15374 +15378 +1537c +15380 +15384 +15388 +1538c +15390 +15394 +15398 +1539c +153a0 +153a4 +153a8 +153ac +153b0 +153b4 +153b8 +153bc +153c0 +153c4 +153c8 +153cc +153d0 +153d4 +153d8 +153dc +153e0 +153e4 +153e8 +153ec +153f0 +153f4 +153f8 +153fc +15400 +15404 +15408 +1540c +15410 +15414 +15418 +1541c +15420 +15424 +15428 +1542c +15430 +15434 +15438 +1543c +15440 +15444 +15448 +1544c +15450 +15454 +15458 +1545c +15460 +15464 +15468 +1546c +15470 +15474 +15478 +1547c +15480 +15484 +15488 +1548c +15490 +15494 +15498 +1549c +154a0 +154a4 +154a8 +154ac +154b0 +154b4 +154b8 +154bc +154c0 +154c4 +154c8 +154cc +154d0 +154d4 +154d8 +154dc +154e0 +154e4 +154e8 +154ec +154f0 +154f4 +154f8 +154fc +15500 +15504 +15508 +1550c +15510 +15514 +15518 +1551c +15520 +15524 +15528 +1552c +15530 +15534 +15538 +1553c +15540 +15544 +15548 +1554c +15550 +15554 +15558 +1555c +15560 +15564 +15568 +1556c +15570 +15574 +15578 +1557c +15580 +15584 +15588 +1558c +15590 +15594 +15598 +1559c +155a0 +155a4 +155a8 +155ac +155b0 +155b4 +155b8 +155bc +155c0 +155c4 +155c8 +155cc +155d0 +155d4 +155d8 +155dc +155e0 +155e4 +155e8 +155ec +155f0 +155f4 +155f8 +155fc +15600 +15604 +15608 +1560c +15610 +15614 +15618 +1561c +15620 +15624 +15628 +1562c +15630 +15634 +15638 +1563c +15640 +15644 +15648 +1564c +15650 +15654 +15658 +1565c +15660 +15664 +15668 +1566c +15670 +15674 +15678 +1567c +15680 +15684 +15688 +1568c +15690 +15694 +15698 +1569c +156a0 +156a4 +156a8 +156ac +156b0 +156b4 +156b8 +156bc +156c0 +156c4 +156c8 +156cc +156d0 +156d4 +156d8 +156dc +156e0 +156e4 +156e8 +156ec +156f0 +156f4 +156f8 +156fc +15700 +15704 +15708 +1570c +15710 +15714 +15718 +1571c +15720 +15724 +15728 +1572c +15730 +15734 +15738 +1573c +15740 +15744 +15748 +1574c +15750 +15754 +15758 +1575c +15760 +15764 +15768 +1576c +15770 +15774 +15778 +1577c +15780 +15784 +15788 +1578c +15790 +15794 +15798 +1579c +157a0 +157a4 +157a8 +157ac +157b0 +157b4 +157b8 +157bc +157c0 +157c4 +157c8 +157cc +157d0 +157d4 +157d8 +157dc +157e0 +157e4 +157e8 +157ec +157f0 +157f4 +157f8 +157fc +15800 +15804 +15808 +1580c +15810 +15814 +15818 +1581c +15820 +15824 +15828 +1582c +15830 +15834 +15838 +1583c +15840 +15844 +15848 +1584c +15850 +15854 +15858 +1585c +15860 +15864 +15868 +1586c +15870 +15874 +15878 +1587c +15880 +15884 +15888 +1588c +15890 +15894 +15898 +1589c +158a0 +158a4 +158a8 +158ac +158b0 +158b4 +158b8 +158bc +158c0 +158c4 +158c8 +158cc +158d0 +158d4 +158d8 +158dc +158e0 +158e4 +158e8 +158ec +158f0 +158f4 +158f8 +158fc +15900 +15904 +15908 +1590c +15910 +15914 +15918 +1591c +15920 +15924 +15928 +1592c +15930 +15934 +15938 +1593c +15940 +15944 +15948 +1594c +15950 +15954 +15958 +1595c +15960 +15964 +15968 +1596c +15970 +15974 +15978 +1597c +15980 +15984 +15988 +1598c +15990 +15994 +15998 +1599c +159a0 +159a4 +159a8 +159ac +159b0 +159b4 +159b8 +159bc +159c0 +159c4 +159c8 +159cc +159d0 +159d4 +159d8 +159dc +159e0 +159e4 +159e8 +159ec +159f0 +159f4 +159f8 +159fc +15a00 +15a04 +15a08 +15a0c +15a10 +15a14 +15a18 +15a1c +15a20 +15a24 +15a28 +15a2c +15a30 +15a34 +15a38 +15a3c +15a40 +15a44 +15a48 +15a4c +15a50 +15a54 +15a58 +15a5c +15a60 +15a64 +15a68 +15a6c +15a70 +15a74 +15a78 +15a7c +15a80 +15a84 +15a88 +15a8c +15a90 +15a94 +15a98 +15a9c +15aa0 +15aa4 +15aa8 +15aac +15ab0 +15ab4 +15ab8 +15abc +15ac0 +15ac4 +15ac8 +15acc +15ad0 +15ad4 +15ad8 +15adc +15ae0 +15ae4 +15ae8 +15aec +15af0 +15af4 +15af8 +15afc +15b00 +15b04 +15b08 +15b0c +15b10 +15b14 +15b18 +15b1c +15b20 +15b24 +15b28 +15b2c +15b30 +15b34 +15b38 +15b3c +15b40 +15b44 +15b48 +15b4c +15b50 +15b54 +15b58 +15b5c +15b60 +15b64 +15b68 +15b6c +15b70 +15b74 +15b78 +15b7c +15b80 +15b84 +15b88 +15b8c +15b90 +15b94 +15b98 +15b9c +15ba0 +15ba4 +15ba8 +15bac +15bb0 +15bb4 +15bb8 +15bbc +15bc0 +15bc4 +15bc8 +15bcc +15bd0 +15bd4 +15bd8 +15bdc +15be0 +15be4 +15be8 +15bec +15bf0 +15bf4 +15bf8 +15bfc +15c00 +15c04 +15c08 +15c0c +15c10 +15c14 +15c18 +15c1c +15c20 +15c24 +15c28 +15c2c +15c30 +15c34 +15c38 +15c3c +15c40 +15c44 +15c48 +15c4c +15c50 +15c54 +15c58 +15c5c +15c60 +15c64 +15c68 +15c6c +15c70 +15c74 +15c78 +15c7c +15c80 +15c84 +15c88 +15c8c +15c90 +15c94 +15c98 +15c9c +15ca0 +15ca4 +15ca8 +15cac +15cb0 +15cb4 +15cb8 +15cbc +15cc0 +15cc4 +15cc8 +15ccc +15cd0 +15cd4 +15cd8 +15cdc +15ce0 +15ce4 +15ce8 +15cec +15cf0 +15cf4 +15cf8 +15cfc +15d00 +15d04 +15d08 +15d0c +15d10 +15d14 +15d18 +15d1c +15d20 +15d24 +15d28 +15d2c +15d30 +15d34 +15d38 +15d3c +15d40 +15d44 +15d48 +15d4c +15d50 +15d54 +15d58 +15d5c +15d60 +15d64 +15d68 +15d6c +15d70 +15d74 +15d78 +15d7c +15d80 +15d84 +15d88 +15d8c +15d90 +15d94 +15d98 +15d9c +15da0 +15da4 +15da8 +15dac +15db0 +15db4 +15db8 +15dbc +15dc0 +15dc4 +15dc8 +15dcc +15dd0 +15dd4 +15dd8 +15ddc +15de0 +15de4 +15de8 +15dec +15df0 +15df4 +15df8 +15dfc +15e00 +15e04 +15e08 +15e0c +15e10 +15e14 +15e18 +15e1c +15e20 +15e24 +15e28 +15e2c +15e30 +15e34 +15e38 +15e3c +15e40 +15e44 +15e48 +15e4c +15e50 +15e54 +15e58 +15e5c +15e60 +15e64 +15e68 +15e6c +15e70 +15e74 +15e78 +15e7c +15e80 +15e84 +15e88 +15e8c +15e90 +15e94 +15e98 +15e9c +15ea0 +15ea4 +15ea8 +15eac +15eb0 +15eb4 +15eb8 +15ebc +15ec0 +15ec4 +15ec8 +15ecc +15ed0 +15ed4 +15ed8 +15edc +15ee0 +15ee4 +15ee8 +15eec +15ef0 +15ef4 +15ef8 +15efc +15f00 +15f04 +15f08 +15f0c +15f10 +15f14 +15f18 +15f1c +15f20 +15f24 +15f28 +15f2c +15f30 +15f34 +15f38 +15f3c +15f40 +15f44 +15f48 +15f4c +15f50 +15f54 +15f58 +15f5c +15f60 +15f64 +15f68 +15f6c +15f70 +15f74 +15f78 +15f7c +15f80 +15f84 +15f88 +15f8c +15f90 +15f94 +15f98 +15f9c +15fa0 +15fa4 +15fa8 +15fac +15fb0 +15fb4 +15fb8 +15fbc +15fc0 +15fc4 +15fc8 +15fcc +15fd0 +15fd4 +15fd8 +15fdc +15fe0 +15fe4 +15fe8 +15fec +15ff0 +15ff4 +15ff8 +15ffc +16000 +16004 +16008 +1600c +16010 +16014 +16018 +1601c +16020 +16024 +16028 +1602c +16030 +16034 +16038 +1603c +16040 +16044 +16048 +1604c +16050 +16054 +16058 +1605c +16060 +16064 +16068 +1606c +16070 +16074 +16078 +1607c +16080 +16084 +16088 +1608c +16090 +16094 +16098 +1609c +160a0 +160a4 +160a8 +160ac +160b0 +160b4 +160b8 +160bc +160c0 +160c4 +160c8 +160cc +160d0 +160d4 +160d8 +160dc +160e0 +160e4 +160e8 +160ec +160f0 +160f4 +160f8 +160fc +16100 +16104 +16108 +1610c +16110 +16114 +16118 +1611c +16120 +16124 +16128 +1612c +16130 +16134 +16138 +1613c +16140 +16144 +16148 +1614c +16150 +16154 +16158 +1615c +16160 +16164 +16168 +1616c +16170 +16174 +16178 +1617c +16180 +16184 +16188 +1618c +16190 +16194 +16198 +1619c +161a0 +161a4 +161a8 +161ac +161b0 +161b4 +161b8 +161bc +161c0 +161c4 +161c8 +161cc +161d0 +161d4 +161d8 +161dc +161e0 +161e4 +161e8 +161ec +161f0 +161f4 +161f8 +161fc +16200 +16204 +16208 +1620c +16210 +16214 +16218 +1621c +16220 +16224 +16228 +1622c +16230 +16234 +16238 +1623c +16240 +16244 +16248 +1624c +16250 +16254 +16258 +1625c +16260 +16264 +16268 +1626c +16270 +16274 +16278 +1627c +16280 +16284 +16288 +1628c +16290 +16294 +16298 +1629c +162a0 +162a4 +162a8 +162ac +162b0 +162b4 +162b8 +162bc +162c0 +162c4 +162c8 +162cc +162d0 +162d4 +162d8 +162dc +162e0 +162e4 +162e8 +162ec +162f0 +162f4 +162f8 +162fc +16300 +16304 +16308 +1630c +16310 +16314 +16318 +1631c +16320 +16324 +16328 +1632c +16330 +16334 +16338 +1633c +16340 +16344 +16348 +1634c +16350 +16354 +16358 +1635c +16360 +16364 +16368 +1636c +16370 +16374 +16378 +1637c +16380 +16384 +16388 +1638c +16390 +16394 +16398 +1639c +163a0 +163a4 +163a8 +163ac +163b0 +163b4 +163b8 +163bc +163c0 +163c4 +163c8 +163cc +163d0 +163d4 +163d8 +163dc +163e0 +163e4 +163e8 +163ec +163f0 +163f4 +163f8 +163fc +16400 +16404 +16408 +1640c +16410 +16414 +16418 +1641c +16420 +16424 +16428 +1642c +16430 +16434 +16438 +1643c +16440 +16444 +16448 +1644c +16450 +16454 +16458 +1645c +16460 +16464 +16468 +1646c +16470 +16474 +16478 +1647c +16480 +16484 +16488 +1648c +16490 +16494 +16498 +1649c +164a0 +164a4 +164a8 +164ac +164b0 +164b4 +164b8 +164bc +164c0 +164c4 +164c8 +164cc +164d0 +164d4 +164d8 +164dc +164e0 +164e4 +164e8 +164ec +164f0 +164f4 +164f8 +164fc +16500 +16504 +16508 +1650c +16510 +16514 +16518 +1651c +16520 +16524 +16528 +1652c +16530 +16534 +16538 +1653c +16540 +16544 +16548 +1654c +16550 +16554 +16558 +1655c +16560 +16564 +16568 +1656c +16570 +16574 +16578 +1657c +16580 +16584 +16588 +1658c +16590 +16594 +16598 +1659c +165a0 +165a4 +165a8 +165ac +165b0 +165b4 +165b8 +165bc +165c0 +165c4 +165c8 +165cc +165d0 +165d4 +165d8 +165dc +165e0 +165e4 +165e8 +165ec +165f0 +165f4 +165f8 +165fc +16600 +16604 +16608 +1660c +16610 +16614 +16618 +1661c +16620 +16624 +16628 +1662c +16630 +16634 +16638 +1663c +16640 +16644 +16648 +1664c +16650 +16654 +16658 +1665c +16660 +16664 +16668 +1666c +16670 +16674 +16678 +1667c +16680 +16684 +16688 +1668c +16690 +16694 +16698 +1669c +166a0 +166a4 +166a8 +166ac +166b0 +166b4 +166b8 +166bc +166c0 +166c4 +166c8 +166cc +166d0 +166d4 +166d8 +166dc +166e0 +166e4 +166e8 +166ec +166f0 +166f4 +166f8 +166fc +16700 +16704 +16708 +1670c +16710 +16714 +16718 +1671c +16720 +16724 +16728 +1672c +16730 +16734 +16738 +1673c +16740 +16744 +16748 +1674c +16750 +16754 +16758 +1675c +16760 +16764 +16768 +1676c +16770 +16774 +16778 +1677c +16780 +16784 +16788 +1678c +16790 +16794 +16798 +1679c +167a0 +167a4 +167a8 +167ac +167b0 +167b4 +167b8 +167bc +167c0 +167c4 +167c8 +167cc +167d0 +167d4 +167d8 +167dc +167e0 +167e4 +167e8 +167ec +167f0 +167f4 +167f8 +167fc +16800 +16804 +16808 +1680c +16810 +16814 +16818 +1681c +16820 +16824 +16828 +1682c +16830 +16834 +16838 +1683c +16840 +16844 +16848 +1684c +16850 +16854 +16858 +1685c +16860 +16864 +16868 +1686c +16870 +16874 +16878 +1687c +16880 +16884 +16888 +1688c +16890 +16894 +16898 +1689c +168a0 +168a4 +168a8 +168ac +168b0 +168b4 +168b8 +168bc +168c0 +168c4 +168c8 +168cc +168d0 +168d4 +168d8 +168dc +168e0 +168e4 +168e8 +168ec +168f0 +168f4 +168f8 +168fc +16900 +16904 +16908 +1690c +16910 +16914 +16918 +1691c +16920 +16924 +16928 +1692c +16930 +16934 +16938 +1693c +16940 +16944 +16948 +1694c +16950 +16954 +16958 +1695c +16960 +16964 +16968 +1696c +16970 +16974 +16978 +1697c +16980 +16984 +16988 +1698c +16990 +16994 +16998 +1699c +169a0 +169a4 +169a8 +169ac +169b0 +169b4 +169b8 +169bc +169c0 +169c4 +169c8 +169cc +169d0 +169d4 +169d8 +169dc +169e0 +169e4 +169e8 +169ec +169f0 +169f4 +169f8 +169fc +16a00 +16a04 +16a08 +16a0c +16a10 +16a14 +16a18 +16a1c +16a20 +16a24 +16a28 +16a2c +16a30 +16a34 +16a38 +16a3c +16a40 +16a44 +16a48 +16a4c +16a50 +16a54 +16a58 +16a5c +16a60 +16a64 +16a68 +16a6c +16a70 +16a74 +16a78 +16a7c +16a80 +16a84 +16a88 +16a8c +16a90 +16a94 +16a98 +16a9c +16aa0 +16aa4 +16aa8 +16aac +16ab0 +16ab4 +16ab8 +16abc +16ac0 +16ac4 +16ac8 +16acc +16ad0 +16ad4 +16ad8 +16adc +16ae0 +16ae4 +16ae8 +16aec +16af0 +16af4 +16af8 +16afc +16b00 +16b04 +16b08 +16b0c +16b10 +16b14 +16b18 +16b1c +16b20 +16b24 +16b28 +16b2c +16b30 +16b34 +16b38 +16b3c +16b40 +16b44 +16b48 +16b4c +16b50 +16b54 +16b58 +16b5c +16b60 +16b64 +16b68 +16b6c +16b70 +16b74 +16b78 +16b7c +16b80 +16b84 +16b88 +16b8c +16b90 +16b94 +16b98 +16b9c +16ba0 +16ba4 +16ba8 +16bac +16bb0 +16bb4 +16bb8 +16bbc +16bc0 +16bc4 +16bc8 +16bcc +16bd0 +16bd4 +16bd8 +16bdc +16be0 +16be4 +16be8 +16bec +16bf0 +16bf4 +16bf8 +16bfc +16c00 +16c04 +16c08 +16c0c +16c10 +16c14 +16c18 +16c1c +16c20 +16c24 +16c28 +16c2c +16c30 +16c34 +16c38 +16c3c +16c40 +16c44 +16c48 +16c4c +16c50 +16c54 +16c58 +16c5c +16c60 +16c64 +16c68 +16c6c +16c70 +16c74 +16c78 +16c7c +16c80 +16c84 +16c88 +16c8c +16c90 +16c94 +16c98 +16c9c +16ca0 +16ca4 +16ca8 +16cac +16cb0 +16cb4 +16cb8 +16cbc +16cc0 +16cc4 +16cc8 +16ccc +16cd0 +16cd4 +16cd8 +16cdc +16ce0 +16ce4 +16ce8 +16cec +16cf0 +16cf4 +16cf8 +16cfc +16d00 +16d04 +16d08 +16d0c +16d10 +16d14 +16d18 +16d1c +16d20 +16d24 +16d28 +16d2c +16d30 +16d34 +16d38 +16d3c +16d40 +16d44 +16d48 +16d4c +16d50 +16d54 +16d58 +16d5c +16d60 +16d64 +16d68 +16d6c +16d70 +16d74 +16d78 +16d7c +16d80 +16d84 +16d88 +16d8c +16d90 +16d94 +16d98 +16d9c +16da0 +16da4 +16da8 +16dac +16db0 +16db4 +16db8 +16dbc +16dc0 +16dc4 +16dc8 +16dcc +16dd0 +16dd4 +16dd8 +16ddc +16de0 +16de4 +16de8 +16dec +16df0 +16df4 +16df8 +16dfc +16e00 +16e04 +16e08 +16e0c +16e10 +16e14 +16e18 +16e1c +16e20 +16e24 +16e28 +16e2c +16e30 +16e34 +16e38 +16e3c +16e40 +16e44 +16e48 +16e4c +16e50 +16e54 +16e58 +16e5c +16e60 +16e64 +16e68 +16e6c +16e70 +16e74 +16e78 +16e7c +16e80 +16e84 +16e88 +16e8c +16e90 +16e94 +16e98 +16e9c +16ea0 +16ea4 +16ea8 +16eac +16eb0 +16eb4 +16eb8 +16ebc +16ec0 +16ec4 +16ec8 +16ecc +16ed0 +16ed4 +16ed8 +16edc +16ee0 +16ee4 +16ee8 +16eec +16ef0 +16ef4 +16ef8 +16efc +16f00 +16f04 +16f08 +16f0c +16f10 +16f14 +16f18 +16f1c +16f20 +16f24 +16f28 +16f2c +16f30 +16f34 +16f38 +16f3c +16f40 +16f44 +16f48 +16f4c +16f50 +16f54 +16f58 +16f5c +16f60 +16f64 +16f68 +16f6c +16f70 +16f74 +16f78 +16f7c +16f80 +16f84 +16f88 +16f8c +16f90 +16f94 +16f98 +16f9c +16fa0 +16fa4 +16fa8 +16fac +16fb0 +16fb4 +16fb8 +16fbc +16fc0 +16fc4 +16fc8 +16fcc +16fd0 +16fd4 +16fd8 +16fdc +16fe0 +16fe4 +16fe8 +16fec +16ff0 +16ff4 +16ff8 +16ffc +17000 +17004 +17008 +1700c +17010 +17014 +17018 +1701c +17020 +17024 +17028 +1702c +17030 +17034 +17038 +1703c +17040 +17044 +17048 +1704c +17050 +17054 +17058 +1705c +17060 +17064 +17068 +1706c +17070 +17074 +17078 +1707c +17080 +17084 +17088 +1708c +17090 +17094 +17098 +1709c +170a0 +170a4 +170a8 +170ac +170b0 +170b4 +170b8 +170bc +170c0 +170c4 +170c8 +170cc +170d0 +170d4 +170d8 +170dc +170e0 +170e4 +170e8 +170ec +170f0 +170f4 +170f8 +170fc +17100 +17104 +17108 +1710c +17110 +17114 +17118 +1711c +17120 +17124 +17128 +1712c +17130 +17134 +17138 +1713c +17140 +17144 +17148 +1714c +17150 +17154 +17158 +1715c +17160 +17164 +17168 +1716c +17170 +17174 +17178 +1717c +17180 +17184 +17188 +1718c +17190 +17194 +17198 +1719c +171a0 +171a4 +171a8 +171ac +171b0 +171b4 +171b8 +171bc +171c0 +171c4 +171c8 +171cc +171d0 +171d4 +171d8 +171dc +171e0 +171e4 +171e8 +171ec +171f0 +171f4 +171f8 +171fc +17200 +17204 +17208 +1720c +17210 +17214 +17218 +1721c +17220 +17224 +17228 +1722c +17230 +17234 +17238 +1723c +17240 +17244 +17248 +1724c +17250 +17254 +17258 +1725c +17260 +17264 +17268 +1726c +17270 +17274 +17278 +1727c +17280 +17284 +17288 +1728c +17290 +17294 +17298 +1729c +172a0 +172a4 +172a8 +172ac +172b0 +172b4 +172b8 +172bc +172c0 +172c4 +172c8 +172cc +172d0 +172d4 +172d8 +172dc +172e0 +172e4 +172e8 +172ec +172f0 +172f4 +172f8 +172fc +17300 +17304 +17308 +1730c +17310 +17314 +17318 +1731c +17320 +17324 +17328 +1732c +17330 +17334 +17338 +1733c +17340 +17344 +17348 +1734c +17350 +17354 +17358 +1735c +17360 +17364 +17368 +1736c +17370 +17374 +17378 +1737c +17380 +17384 +17388 +1738c +17390 +17394 +17398 +1739c +173a0 +173a4 +173a8 +173ac +173b0 +173b4 +173b8 +173bc +173c0 +173c4 +173c8 +173cc +173d0 +173d4 +173d8 +173dc +173e0 +173e4 +173e8 +173ec +173f0 +173f4 +173f8 +173fc +17400 +17404 +17408 +1740c +17410 +17414 +17418 +1741c +17420 +17424 +17428 +1742c +17430 +17434 +17438 +1743c +17440 +17444 +17448 +1744c +17450 +17454 +17458 +1745c +17460 +17464 +17468 +1746c +17470 +17474 +17478 +1747c +17480 +17484 +17488 +1748c +17490 +17494 +17498 +1749c +174a0 +174a4 +174a8 +174ac +174b0 +174b4 +174b8 +174bc +174c0 +174c4 +174c8 +174cc +174d0 +174d4 +174d8 +174dc +174e0 +174e4 +174e8 +174ec +174f0 +174f4 +174f8 +174fc +17500 +17504 +17508 +1750c +17510 +17514 +17518 +1751c +17520 +17524 +17528 +1752c +17530 +17534 +17538 +1753c +17540 +17544 +17548 +1754c +17550 +17554 +17558 +1755c +17560 +17564 +17568 +1756c +17570 +17574 +17578 +1757c +17580 +17584 +17588 +1758c +17590 +17594 +17598 +1759c +175a0 +175a4 +175a8 +175ac +175b0 +175b4 +175b8 +175bc +175c0 +175c4 +175c8 +175cc +175d0 +175d4 +175d8 +175dc +175e0 +175e4 +175e8 +175ec +175f0 +175f4 +175f8 +175fc +17600 +17604 +17608 +1760c +17610 +17614 +17618 +1761c +17620 +17624 +17628 +1762c +17630 +17634 +17638 +1763c +17640 +17644 +17648 +1764c +17650 +17654 +17658 +1765c +17660 +17664 +17668 +1766c +17670 +17674 +17678 +1767c +17680 +17684 +17688 +1768c +17690 +17694 +17698 +1769c +176a0 +176a4 +176a8 +176ac +176b0 +176b4 +176b8 +176bc +176c0 +176c4 +176c8 +176cc +176d0 +176d4 +176d8 +176dc +176e0 +176e4 +176e8 +176ec +176f0 +176f4 +176f8 +176fc +17700 +17704 +17708 +1770c +17710 +17714 +17718 +1771c +17720 +17724 +17728 +1772c +17730 +17734 +17738 +1773c +17740 +17744 +17748 +1774c +17750 +17754 +17758 +1775c +17760 +17764 +17768 +1776c +17770 +17774 +17778 +1777c +17780 +17784 +17788 +1778c +17790 +17794 +17798 +1779c +177a0 +177a4 +177a8 +177ac +177b0 +177b4 +177b8 +177bc +177c0 +177c4 +177c8 +177cc +177d0 +177d4 +177d8 +177dc +177e0 +177e4 +177e8 +177ec +177f0 +177f4 +177f8 +177fc +17800 +17804 +17808 +1780c +17810 +17814 +17818 +1781c +17820 +17824 +17828 +1782c +17830 +17834 +17838 +1783c +17840 +17844 +17848 +1784c +17850 +17854 +17858 +1785c +17860 +17864 +17868 +1786c +17870 +17874 +17878 +1787c +17880 +17884 +17888 +1788c +17890 +17894 +17898 +1789c +178a0 +178a4 +178a8 +178ac +178b0 +178b4 +178b8 +178bc +178c0 +178c4 +178c8 +178cc +178d0 +178d4 +178d8 +178dc +178e0 +178e4 +178e8 +178ec +178f0 +178f4 +178f8 +178fc +17900 +17904 +17908 +1790c +17910 +17914 +17918 +1791c +17920 +17924 +17928 +1792c +17930 +17934 +17938 +1793c +17940 +17944 +17948 +1794c +17950 +17954 +17958 +1795c +17960 +17964 +17968 +1796c +17970 +17974 +17978 +1797c +17980 +17984 +17988 +1798c +17990 +17994 +17998 +1799c +179a0 +179a4 +179a8 +179ac +179b0 +179b4 +179b8 +179bc +179c0 +179c4 +179c8 +179cc +179d0 +179d4 +179d8 +179dc +179e0 +179e4 +179e8 +179ec +179f0 +179f4 +179f8 +179fc +17a00 +17a04 +17a08 +17a0c +17a10 +17a14 +17a18 +17a1c +17a20 +17a24 +17a28 +17a2c +17a30 +17a34 +17a38 +17a3c +17a40 +17a44 +17a48 +17a4c +17a50 +17a54 +17a58 +17a5c +17a60 +17a64 +17a68 +17a6c +17a70 +17a74 +17a78 +17a7c +17a80 +17a84 +17a88 +17a8c +17a90 +17a94 +17a98 +17a9c +17aa0 +17aa4 +17aa8 +17aac +17ab0 +17ab4 +17ab8 +17abc +17ac0 +17ac4 +17ac8 +17acc +17ad0 +17ad4 +17ad8 +17adc +17ae0 +17ae4 +17ae8 +17aec +17af0 +17af4 +17af8 +17afc +17b00 +17b04 +17b08 +17b0c +17b10 +17b14 +17b18 +17b1c +17b20 +17b24 +17b28 +17b2c +17b30 +17b34 +17b38 +17b3c +17b40 +17b44 +17b48 +17b4c +17b50 +17b54 +17b58 +17b5c +17b60 +17b64 +17b68 +17b6c +17b70 +17b74 +17b78 +17b7c +17b80 +17b84 +17b88 +17b8c +17b90 +17b94 +17b98 +17b9c +17ba0 +17ba4 +17ba8 +17bac +17bb0 +17bb4 +17bb8 +17bbc +17bc0 +17bc4 +17bc8 +17bcc +17bd0 +17bd4 +17bd8 +17bdc +17be0 +17be4 +17be8 +17bec +17bf0 +17bf4 +17bf8 +17bfc +17c00 +17c04 +17c08 +17c0c +17c10 +17c14 +17c18 +17c1c +17c20 +17c24 +17c28 +17c2c +17c30 +17c34 +17c38 +17c3c +17c40 diff --git a/tests/test-progs/nops/src/generic_2/secret.c b/tests/test-progs/nops/src/generic_2/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..4491051c2badf300522d10d3fe66873d31c85954 --- /dev/null +++ b/tests/test-progs/nops/src/generic_2/secret.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020, French Institute for Research in Computer Science and + * Automation + * Author: Pierre-Yves Peneau <first.last@inria.fr> + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the <organization> nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 +#include "aes.h" + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + AESEncrypt(cipher, plain, key); + printf("%s\n", cipher); + + return 0; +} diff --git a/tests/test-progs/nops/src/handler/Makefile b/tests/test-progs/nops/src/handler/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fb9f81fd07a6ab61a003f6b5cd8285c9a58dbe67 --- /dev/null +++ b/tests/test-progs/nops/src/handler/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 +OUT=../../bin + +TARGET=secret_handler + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c aes.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/handler/aes.c b/tests/test-progs/nops/src/handler/aes.c new file mode 100644 index 0000000000000000000000000000000000000000..96088f23108b9f6dc66972abfdfdfb4088856a85 --- /dev/null +++ b/tests/test-progs/nops/src/handler/aes.c @@ -0,0 +1,417 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + +#include "aes.h" + +//---------------------------------------------------------- +// AES128 encryption +//---------------------------------------------------------- +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + +//---------------------------------------------------------- +// AES Round functions +//---------------------------------------------------------- +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +//---------------------------------------------------------- +// Génération de clé +//---------------------------------------------------------- +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE],int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = + sboxtab[column[0]] ^ rcon[round-1] ^ keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey(unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + +//---------------------------------------------------------- +// Other useful functions +//---------------------------------------------------------- +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message[], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey(unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0]= gmul(column_tmp[0],2) ^ gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[1],3); + column[1]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ gmul(column_tmp[3],1); + column[2]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ gmul(column_tmp[3],3); + column[3]= gmul(column_tmp[0],3) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +//---------------------------------------------------------- +// Tables +//---------------------------------------------------------- +unsigned char trigger_sel = 1; + +const unsigned char rcon [10]={0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, + 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, + 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, + 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, + 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, + 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, + 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, + 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, + 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, + 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, + 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, + 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, + 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, + 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }; diff --git a/tests/test-progs/nops/src/handler/aes.h b/tests/test-progs/nops/src/handler/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..9239b7775e2136a0c25be7bff8280bb49f412bbe --- /dev/null +++ b/tests/test-progs/nops/src/handler/aes.h @@ -0,0 +1,52 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + + + +#ifndef AES_H +#define AES_H + +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + +#endif diff --git a/tests/test-progs/nops/src/handler/nops.txt b/tests/test-progs/nops/src/handler/nops.txt new file mode 100644 index 0000000000000000000000000000000000000000..c60fbde23875a24e972d134e4ab987206826b5c4 --- /dev/null +++ b/tests/test-progs/nops/src/handler/nops.txt @@ -0,0 +1,1873 @@ +# Entry point +10528 +# The addresses to skip +105f0 +105f4 +105f8 +105fc +10600 +10604 +10608 +1060c +10610 +10614 +10618 +1061c +10620 +10624 +10628 +1062c +10630 +10634 +10638 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +1067c +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +106a0 +106a4 +106a8 +106ac +106b0 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +106e4 +106e8 +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +1072c +10730 +10734 +10738 +1073c +10740 +10744 +10748 +1074c +10750 +10754 +10758 +1075c +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +10964 +10968 +1096c +10970 +10974 +10978 +1097c +10980 +10984 +10988 +1098c +10990 +10994 +10998 +1099c +109a0 +109a4 +109a8 +109ac +109b0 +109b4 +109b8 +109bc +109c0 +109c4 +109c8 +109cc +109d0 +109d4 +109d8 +109dc +109e0 +109e4 +109e8 +109ec +109f0 +109f4 +109f8 +109fc +10a00 +10a04 +10a08 +10a0c +10a10 +10a14 +10a18 +10a1c +10a20 +10a24 +10a28 +10a2c +10a30 +10a34 +10a38 +10a3c +10a40 +10a44 +10a48 +10a4c +10a50 +10a54 +10a58 +10a5c +10a60 +10a64 +10a68 +10a6c +10a70 +10a74 +10a78 +10a7c +10a80 +10a84 +10a88 +10a8c +10a90 +10a94 +10a98 +10a9c +10aa0 +10aa4 +10aa8 +10aac +10ab0 +10ab4 +10ab8 +10abc +10ac0 +10ac4 +10ac8 +10acc +10ad0 +10ad4 +10ad8 +10adc +10ae0 +10ae4 +10ae8 +10aec +10af0 +10af4 +10af8 +10afc +10b00 +10b04 +10b08 +10b0c +10b10 +10b14 +10b18 +10b1c +10b20 +10b24 +10b28 +10b2c +10b30 +10b34 +10b38 +10b3c +10b40 +10b44 +10b48 +10b4c +10b50 +10b54 +10b58 +10b5c +10b60 +10b64 +10b68 +10b6c +10b70 +10b74 +10b78 +10b7c +10b80 +10b84 +10b88 +10b8c +10b90 +10b94 +10b98 +10b9c +10ba0 +10ba4 +10ba8 +10bac +10bb0 +10bb4 +10bb8 +10bbc +10bc0 +10bc4 +10bc8 +10bcc +10bd0 +10bd4 +10bd8 +10bdc +10be0 +10be4 +10be8 +10bec +10bf0 +10bf4 +10bf8 +10bfc +10c00 +10c04 +10c08 +10c0c +10c10 +10c14 +10c18 +10c1c +10c20 +10c24 +10c28 +10c2c +10c30 +10c34 +10c38 +10c3c +10c40 +10c44 +10c48 +10c4c +10c50 +10c54 +10c58 +10c5c +10c60 +10c64 +10c68 +10c6c +10c70 +10c74 +10c78 +10c7c +10c80 +10c84 +10c88 +10c8c +10c90 +10c94 +10c98 +10c9c +10ca0 +10ca4 +10ca8 +10cac +10cb0 +10cb4 +10cb8 +10cbc +10cc0 +10cc4 +10cc8 +10ccc +10cd0 +10cd4 +10cd8 +10cdc +10ce0 +10ce4 +10ce8 +10cec +10cf0 +10cf4 +10cf8 +10cfc +10d00 +10d04 +10d08 +10d0c +10d10 +10d14 +10d18 +10d1c +10d20 +10d24 +10d28 +10d2c +10d30 +10d34 +10d38 +10d3c +10d40 +10d44 +10d48 +10d4c +10d50 +10d54 +10d58 +10d5c +10d60 +10d64 +10d68 +10d6c +10d70 +10d74 +10d78 +10d7c +10d80 +10d84 +10d88 +10d8c +10d90 +10d94 +10d98 +10d9c +10da0 +10da4 +10da8 +10dac +10db0 +10db4 +10db8 +10dbc +10dc0 +10dc4 +10dc8 +10dcc +10dd0 +10dd4 +10dd8 +10ddc +10de0 +10de4 +10de8 +10dec +10df0 +10df4 +10df8 +10dfc +10e00 +10e04 +10e08 +10e0c +10e10 +10e14 +10e18 +10e1c +10e20 +10e24 +10e28 +10e2c +10e30 +10e34 +10e38 +10e3c +10e40 +10e44 +10e48 +10e4c +10e50 +10e54 +10e58 +10e5c +10e60 +10e64 +10e68 +10e6c +10e70 +10e74 +10e78 +10e7c +10e80 +10e84 +10e88 +10e8c +10e90 +10e94 +10e98 +10e9c +10ea0 +10ea4 +10ea8 +10eac +10eb0 +10eb4 +10eb8 +10ebc +10ec0 +10ec4 +10ec8 +10ecc +10ed0 +10ed4 +10ed8 +10edc +10ee0 +10ee4 +10ee8 +10eec +10ef0 +10ef4 +10ef8 +10efc +10f00 +10f04 +10f08 +10f0c +10f10 +10f14 +10f18 +10f1c +10f20 +10f24 +10f28 +10f2c +10f30 +10f34 +10f38 +10f3c +10f40 +10f44 +10f48 +10f4c +10f50 +10f54 +10f58 +10f5c +10f60 +10f64 +10f68 +10f6c +10f70 +10f74 +10f78 +10f7c +10f80 +10f84 +10f88 +10f8c +10f90 +10f94 +10f98 +10f9c +10fa0 +10fa4 +10fa8 +10fac +10fb0 +10fb4 +10fb8 +10fbc +10fc0 +10fc4 +10fc8 +10fcc +10fd0 +10fd4 +10fd8 +10fdc +10fe0 +10fe4 +10fe8 +10fec +10ff0 +10ff4 +10ff8 +10ffc +11000 +11004 +11008 +1100c +11010 +11014 +11018 +1101c +11020 +11024 +11028 +1102c +11030 +11034 +11038 +1103c +11040 +11044 +11048 +1104c +11050 +11054 +11058 +1105c +11060 +11064 +11068 +1106c +11070 +11074 +11078 +1107c +11080 +11084 +11088 +1108c +11090 +11094 +11098 +1109c +110a0 +110a4 +110a8 +110ac +110b0 +110b4 +110b8 +110bc +110c0 +110c4 +110c8 +110cc +110d0 +110d4 +110d8 +110dc +110e0 +110e4 +110e8 +110ec +110f0 +110f4 +110f8 +110fc +11100 +11104 +11108 +1110c +11110 +11114 +11118 +1111c +11120 +11124 +11128 +1112c +11130 +11134 +11138 +1113c +11140 +11144 +11148 +1114c +11150 +11154 +11158 +1115c +11160 +11164 +11168 +1116c +11170 +11174 +11178 +1117c +11180 +11184 +11188 +1118c +11190 +11194 +11198 +1119c +111a0 +111a4 +111a8 +111ac +111b0 +111b4 +111b8 +111bc +111c0 +111c4 +111c8 +111cc +111d0 +111d4 +111d8 +111dc +111e0 +111e4 +111e8 +111ec +111f0 +111f4 +111f8 +111fc +11200 +11204 +11208 +1120c +11210 +11214 +11218 +1121c +11220 +11224 +11228 +1122c +11230 +11234 +11238 +1123c +11240 +11244 +11248 +1124c +11250 +11254 +11258 +1125c +11260 +11264 +11268 +1126c +11270 +11274 +11278 +1127c +11280 +11284 +11288 +1128c +11290 +11294 +11298 +1129c +112a0 +112a4 +112a8 +112ac +112b0 +112b4 +112b8 +112bc +112c0 +112c4 +112c8 +112cc +112d0 +112d4 +112d8 +112dc +112e0 +112e4 +112e8 +112ec +112f0 +112f4 +112f8 +112fc +11300 +11304 +11308 +1130c +11310 +11314 +11318 +1131c +11320 +11324 +11328 +1132c +11330 +11334 +11338 +1133c +11340 +11344 +11348 +1134c +11350 +11354 +11358 +1135c +11360 +11364 +11368 +1136c +11370 +11374 +11378 +1137c +11380 +11384 +11388 +1138c +11390 +11394 +11398 +1139c +113a0 +113a4 +113a8 +113ac +113b0 +113b4 +113b8 +113bc +113c0 +113c4 +113c8 +113cc +113d0 +113d4 +113d8 +113dc +113e0 +113e4 +113e8 +113ec +113f0 +113f4 +113f8 +113fc +11400 +11404 +11408 +1140c +11410 +11414 +11418 +1141c +11420 +11424 +11428 +1142c +11430 +11434 +11438 +1143c +11440 +11444 +11448 +1144c +11450 +11454 +11458 +1145c +11460 +11464 +11468 +1146c +11470 +11474 +11478 +1147c +11480 +11484 +11488 +1148c +11490 +11494 +11498 +1149c +114a0 +114a4 +114a8 +114ac +114b0 +114b4 +114b8 +114bc +114c0 +114c4 +114c8 +114cc +114d0 +114d4 +114d8 +114dc +114e0 +114e4 +114e8 +114ec +114f0 +114f4 +114f8 +114fc +11500 +11504 +11508 +1150c +11510 +11514 +11518 +1151c +11520 +11524 +11528 +1152c +11530 +11534 +11538 +1153c +11540 s:1 +11544 s:1 +11548 s:1 +1154c s:1 +11550 s:1 +11554 s:1 +11558 s:1 +1155c s:1 +11560 s:1 +11564 s:1 +11568 s:1 +1156c s:1 +11570 s:1 +11574 s:1 +11578 s:1 +1157c s:1 +11580 s:1 +11584 s:1 +11588 s:1 +1158c s:1 +11590 s:1 +11594 s:1 +11598 s:1 +1159c s:1 +115a0 s:1 +115a4 s:1 +115a8 s:1 +115ac s:1 +115b0 s:1 +115b4 s:1 +115b8 s:1 +115bc s:1 +115c0 s:1 +115c4 s:1 +115c8 s:1 +115cc s:1 +115d0 s:1 +115d4 s:1 +115d8 s:1 +115dc s:1 +115e0 s:1 +115e4 s:1 +115e8 s:1 +115ec s:1 +115f0 s:1 +115f4 s:1 +115f8 s:1 +115fc s:1 +11600 s:1 +11604 s:1 +11608 s:1 +1160c s:1 +11610 s:1 +11614 s:1 +11618 s:1 +1161c s:1 +11620 s:1 +11624 s:1 +11628 s:1 +1162c s:1 +11630 s:1 +11634 s:1 +11638 s:1 +1163c s:1 +11640 s:1 +11644 s:1 +11648 s:1 +1164c s:1 +11650 s:1 +11654 s:1 +11658 s:1 +1165c s:1 +11660 s:1 +11664 s:1 +11668 s:1 +1166c s:1 +11670 s:1 +11674 s:1 +11678 s:1 +1167c s:1 +11680 s:1 +11684 s:1 +11688 s:1 +1168c s:1 +11690 s:1 +11694 s:1 +11698 s:1 +1169c s:1 +116a0 s:1 +116a4 s:1 +116a8 s:1 +116ac s:1 +116b0 s:1 +116b4 s:1 +116b8 s:1 +116bc s:1 +116c0 s:1 +116c4 s:1 +116c8 s:1 +116cc s:1 +116d0 s:1 +116d4 s:1 +116d8 s:1 +116dc s:1 +116e0 s:1 +116e4 s:1 +116e8 s:1 +116ec s:1 +116f0 s:1 +116f4 s:1 +116f8 s:1 +116fc s:1 +11700 s:1 +11704 s:1 +11708 s:1 +1170c s:1 +11710 s:1 +11714 s:1 +11718 s:1 +1171c s:1 +11720 s:1 +11724 s:1 +11728 s:1 +1172c s:1 +11730 s:1 +11734 s:1 +11738 s:1 +1173c s:1 +11740 s:1 +11744 s:1 +11748 s:1 +1174c s:1 +11750 s:1 +11754 s:1 +11758 s:1 +1175c s:1 +11760 s:1 +11764 s:1 +11768 s:1 +1176c s:1 +11770 s:1 +11774 s:1 +11778 s:1 +1177c s:1 +11780 s:1 +11784 s:1 +11788 s:1 +1178c s:1 +11790 s:1 +11794 s:1 +11798 s:1 +1179c s:1 +117a0 s:1 +117a4 s:1 +117a8 s:1 +117ac s:1 +117b0 s:1 +117b4 s:1 +117b8 s:1 +117bc s:1 +117c0 s:1 +117c4 s:1 +117c8 s:1 +117cc s:1 +117d0 s:1 +117d4 s:1 +117d8 s:1 +117dc s:1 +117e0 s:1 +117e4 s:1 +117e8 s:1 +117ec s:1 +117f0 s:1 +117f4 s:1 +117f8 s:1 +117fc s:1 +11800 s:1 +11804 s:1 +11808 s:1 +1180c s:1 +11810 s:1 +11814 s:1 +11818 s:1 +1181c s:1 +11820 s:1 +11824 s:1 +11828 s:1 +1182c s:1 +11830 s:1 +11834 s:1 +11838 s:1 +1183c s:1 +11840 s:1 +11844 s:1 +11848 s:1 +1184c s:1 +11850 s:1 +11854 s:1 +11858 s:1 +1185c s:1 +11860 s:1 +11864 s:1 +11868 s:1 +1186c s:1 +11870 s:1 +11874 s:1 +11878 s:1 +1187c s:1 +11880 s:1 +11884 s:1 +11888 s:1 +1188c s:1 +11890 s:1 +11894 s:1 +11898 s:1 +1189c s:1 +118a0 s:1 +118a4 s:1 +118a8 s:1 +118ac s:1 +118b0 s:1 +118b4 s:1 +118b8 s:1 +118bc s:1 +118c0 s:1 +118c4 +118c8 +118cc +118d0 +118d4 +118d8 +118dc +118e0 +118e4 +118e8 +118ec +118f0 +118f4 +118f8 +118fc +11900 +11904 +11908 +1190c +11910 +11914 +11918 +1191c +11920 +11924 +11928 +1192c +11930 +11934 +11938 +1193c +11940 +11944 +11948 +1194c +11950 +11954 +11958 +1195c +11960 +11964 +11968 +1196c +11970 +11974 +11978 +1197c +11980 +11984 +11988 +1198c +11990 +11994 +11998 +1199c +119a0 +119a4 +119a8 +119ac +119b0 +119b4 +119b8 +119bc +119c0 +119c4 +119c8 +119cc +119d0 +119d4 +119d8 +119dc +119e0 +119e4 +119e8 +119ec +119f0 +119f4 +119f8 +119fc +11a00 +11a04 +11a08 +11a0c +11a10 +11a14 +11a18 +11a1c +11a20 +11a24 +11a28 +11a2c +11a30 +11a34 +11a38 +11a3c +11a40 +11a44 +11a48 +11a4c +11a50 +11a54 +11a58 +11a5c +11a60 +11a64 +11a68 +11a6c +11a70 +11a74 +11a78 +11a7c +11a80 +11a84 +11a88 +11a8c +11a90 +11a94 +11a98 +11a9c +11aa0 +11aa4 +11aa8 +11aac +11ab0 +11ab4 +11ab8 +11abc +11ac0 +11ac4 +11ac8 +11acc +11ad0 +11ad4 +11ad8 +11adc +11ae0 +11ae4 +11ae8 +11aec +11af0 +11af4 +11af8 +11afc +11b00 +11b04 +11b08 +11b0c +11b10 +11b14 +11b18 +11b1c +11b20 +11b24 +11b28 +11b2c +11b30 +11b34 +11b38 +11b3c +11b40 +11b44 +11b48 +11b4c +11b50 +11b54 +11b58 +11b5c +11b60 +11b64 +11b68 +11b6c +11b70 +11b74 +11b78 +11b7c +11b80 +11b84 +11b88 +11b8c +11b90 +11b94 +11b98 +11b9c +11ba0 +11ba4 +11ba8 +11bac +11bb0 +11bb4 +11bb8 +11bbc +11bc0 +11bc4 +11bc8 +11bcc +11bd0 +11bd4 +11bd8 +11bdc +11be0 +11be4 +11be8 +11bec +11bf0 +11bf4 +11bf8 +11bfc +11c00 +11c04 +11c08 +11c0c +11c10 +11c14 +11c18 +11c1c +11c20 +11c24 +11c28 +11c2c +11c30 +11c34 +11c38 +11c3c +11c40 +11c44 +11c48 +11c4c +11c50 +11c54 +11c58 +11c5c +11c60 +11c64 +11c68 +11c6c +11c70 +11c74 +11c78 +11c7c +11c80 +11c84 +11c88 +11c8c +11c90 +11c94 +11c98 +11c9c +11ca0 +11ca4 +11ca8 +11cac +11cb0 +11cb4 +11cb8 +11cbc +11cc0 +11cc4 +11cc8 +11ccc +11cd0 +11cd4 +11cd8 +11cdc +11ce0 +11ce4 +11ce8 +11cec +11cf0 +11cf4 +11cf8 +11cfc +11d00 +11d04 +11d08 +11d0c +11d10 +11d14 +11d18 +11d1c +11d20 +11d24 +11d28 +11d2c +11d30 +11d34 +11d38 +11d3c +11d40 +11d44 +11d48 +11d4c +11d50 +11d54 +11d58 +11d5c +11d60 +11d64 +11d68 +11d6c +11d70 +11d74 +11d78 +11d7c +11d80 e:11 s:1 +11d84 e:11 s:1 +11d88 +11d8c +11d90 +11d94 +11d98 +11d9c +11da0 +11da4 +11da8 +11dac +11db0 +11db4 +11db8 +11dbc +11dc0 +11dc4 +11dc8 +11dcc +11dd0 +11dd4 +11dd8 +11ddc +11de0 +11de4 +11de8 +11dec +11df0 +11df4 +11df8 +11dfc +11e00 +11e04 +11e08 +11e0c +11e10 +11e14 +11e18 +11e1c +11e20 +11e24 +11e28 +11e2c +11e30 +11e34 +11e38 +11e3c +11e40 +11e44 +11e48 +11e4c +11e50 +11e54 +11e58 +11e5c +11e60 +11e64 +11e68 +11e6c +11e70 +11e74 +11e78 +11e7c +11e80 +11e84 +11e88 +11e8c +11e90 +11e94 +11e98 +11e9c +11ea0 +11ea4 +11ea8 +11eac +11eb0 +11eb4 +11eb8 +11ebc +11ec0 +11ec4 +11ec8 +11ecc +11ed0 +11ed4 +11ed8 +11edc +11ee0 +11ee4 +11ee8 +11eec +11ef0 +10174 +10178 +1017c +10180 +10184 +10188 +1018c +10190 +10194 +10198 +1019c +101a0 +101a4 +101a8 +101ac +101b0 +101b4 +101b8 +101bc +101c0 +101c4 +101c8 +101cc +101d0 +101d4 +101d8 +101dc +101e0 +101e4 +101e8 +101ec +101f0 +101f4 +101f8 +101fc +10200 +10204 +10208 +1020c +10210 +10214 +10218 +1021c +10220 +10224 +10228 +1022c +10230 +10234 +10238 +1023c +10240 +10244 +10248 +1024c +10250 +10254 +10258 +1025c +10260 +10264 +10268 +1026c +10270 +10274 +10278 +1027c +10280 +10284 +10288 +1028c +10290 +10294 +10298 +1029c +102a0 +102a4 +102a8 +102ac +102b0 +102b4 +102b8 +102bc +102c0 +102c4 +102c8 +102cc +102d0 +102d4 +102d8 +102dc +102e0 +102e4 +102e8 +102ec +102f0 +102f4 +102f8 +102fc +10300 +10304 +10308 +1030c +10310 +10314 +10318 +1031c +10320 +10324 +10328 +1032c +10330 +10334 +10338 +1033c +10340 +10344 +10348 +1034c +10350 +10354 +10358 +1035c +10360 +10364 +10368 +1036c +10370 +10374 +10378 +1037c +10380 +10384 +10388 +1038c +10390 +10394 +10398 +1039c +103a0 +103a4 +103a8 +103ac +103b0 +103b4 +103b8 +103bc +103c0 +103c4 +103c8 +103cc +103d0 +103d4 +103d8 +103dc +103e0 +103e4 +103e8 +103ec +103f0 +103f4 +103f8 +103fc +10400 +10404 +10408 +1040c +10410 +10414 +10418 +1041c +10420 +10424 +10428 +1042c +10430 +10434 +10438 +1043c +10440 +10444 +10448 +1044c +10450 +10454 +10458 +1045c +10460 +10464 +10468 +1046c +10470 +10474 +10478 +1047c +10480 +10484 +10488 +1048c +10490 +10494 +10498 +1049c +104a0 +104a4 +104a8 +104ac +104b0 +104b4 +104b8 +104bc +104c0 +104c4 +104c8 +104cc +104d0 +104d4 +104d8 +104dc +104e0 +104e4 +104e8 +104ec +104f0 +104f4 +104f8 +104fc +10500 +10504 +10508 +1050c +10510 +10514 +10518 +1051c +10520 +10524 +10528 e:1 s:1 +1052c e:1 s:1 +10530 e:1 s:1 +10534 e:1 s:1 +10538 e:1 s:1 +1053c e:1 s:1 +10540 e:1 s:1 +10544 e:1 s:1 +10548 e:1 s:1 +1054c e:1 s:1 +10550 e:1 s:1 +10554 e:1 s:1 +10558 e:1 s:1 +1055c e:1 s:1 +10560 e:1 s:1 +10564 e:1 s:1 +10568 e:1 s:1 +1056c e:1 s:1 +10570 e:1 s:1 +10574 e:1 s:1 +10578 e:1 s:1 +1057c e:1 s:1 +10580 e:1 s:1 +10584 e:1 s:1 +10588 e:1 s:1 +1058c e:1 s:1 +10590 e:1 s:1 +10594 e:1 s:1 +10598 e:1 s:1 +1059c e:1 s:1 +105a0 e:1 s:1 +105a4 s:1 diff --git a/tests/test-progs/nops/src/handler/secret.c b/tests/test-progs/nops/src/handler/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..4491051c2badf300522d10d3fe66873d31c85954 --- /dev/null +++ b/tests/test-progs/nops/src/handler/secret.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020, French Institute for Research in Computer Science and + * Automation + * Author: Pierre-Yves Peneau <first.last@inria.fr> + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the <organization> nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 +#include "aes.h" + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + AESEncrypt(cipher, plain, key); + printf("%s\n", cipher); + + return 0; +} diff --git a/tests/test-progs/nops/src/hello/Makefile b/tests/test-progs/nops/src/hello/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..cf519386a899ea954d5a1580d9ca02ba54f2216e --- /dev/null +++ b/tests/test-progs/nops/src/hello/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 -fomit-frame-pointer +OUT=../../bin + +TARGET=secret_hello + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c aes.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/hello/aes.c b/tests/test-progs/nops/src/hello/aes.c new file mode 100644 index 0000000000000000000000000000000000000000..96088f23108b9f6dc66972abfdfdfb4088856a85 --- /dev/null +++ b/tests/test-progs/nops/src/hello/aes.c @@ -0,0 +1,417 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + +#include "aes.h" + +//---------------------------------------------------------- +// AES128 encryption +//---------------------------------------------------------- +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + +//---------------------------------------------------------- +// AES Round functions +//---------------------------------------------------------- +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +//---------------------------------------------------------- +// Génération de clé +//---------------------------------------------------------- +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE],int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = + sboxtab[column[0]] ^ rcon[round-1] ^ keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey(unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + +//---------------------------------------------------------- +// Other useful functions +//---------------------------------------------------------- +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message[], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey(unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0]= gmul(column_tmp[0],2) ^ gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[1],3); + column[1]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ gmul(column_tmp[3],1); + column[2]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ gmul(column_tmp[3],3); + column[3]= gmul(column_tmp[0],3) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +//---------------------------------------------------------- +// Tables +//---------------------------------------------------------- +unsigned char trigger_sel = 1; + +const unsigned char rcon [10]={0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, + 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, + 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, + 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, + 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, + 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, + 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, + 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, + 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, + 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, + 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, + 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, + 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, + 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }; diff --git a/tests/test-progs/nops/src/hello/aes.h b/tests/test-progs/nops/src/hello/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..9239b7775e2136a0c25be7bff8280bb49f412bbe --- /dev/null +++ b/tests/test-progs/nops/src/hello/aes.h @@ -0,0 +1,52 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + + + +#ifndef AES_H +#define AES_H + +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + +#endif diff --git a/tests/test-progs/nops/src/hello/nops-crash.txt b/tests/test-progs/nops/src/hello/nops-crash.txt new file mode 100644 index 0000000000000000000000000000000000000000..9371a959bbf640d22ca409d176343fe7e97d775a --- /dev/null +++ b/tests/test-progs/nops/src/hello/nops-crash.txt @@ -0,0 +1,295 @@ +10528 +# Avoid printf() at each generated char except the last one +105a8 s:11 +# Hijack AESsencrpyt() +# keep the 3 first instructions +105cc +105d0 +105d4 +105d8 +105dc +105e0 +105e4 +105e8 +105ec +105f0 +105f4 +105f8 +105fc +10600 +10604 +10608 +1060c +10610 +10614 +10618 +#1061c # Always init r3 to 1 +10620 +10624 +# +# 10628: first instruction in the loop, cannot be skipped (except first round +# to reach the bottom of the loop) +# Composed of s+e, where the sum is the number of loop +10628 s:1 e:577598 s:1 e:577599 s:1 e:577600 s:1 e:577601 s:1 e:577602 s:1 e:577603 s:1 e:577604 s:1 e:577605 s:1 e:577606 s:1 e:577607 s:1 e:577608 s:1 e:577609 +1062c +10630 +# 10634: Get the value of r3 from the stack (except first loop) +# Composed of s+e, where the sum is the number of loop +10634 s:1 e:577598 s:1 e:577599 s:1 e:577600 s:1 e:577601 s:1 e:577602 s:1 e:577603 s:1 e:577604 s:1 e:577605 s:1 e:577606 s:1 e:577607 s:1 e:577608 s:1 e:577609 +# 10638: cmp r2, r3 : need to execute to set LE flag to 1 +# Composed of e+s, where the sum is the number of loop +10638 e:1 s:577598 e:1 s:577599 e:1 s:577600 e:1 s:577601 e:1 s:577602 e:1 s:577603 e:1 s:577604 e:1 s:577605 e:1 s:577606 e:1 s:577607 e:1 s:577608 e:1 s:577609 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +# Skip until value is of char is in r2 then execute once +# Composed of s+e+s, where the sum is equal to the number of loop +# H = 72 = 577999 iterations +# e = 101 = 577600 iterations +# l = 108 = 577601 iterations +# l = 108 = 577602 iterations +# o = 111 = 577603 iterations +# = 32 = 577604 iterations +# W = 87 = 577605 iterations +# o = 111 = 577606 iterations +# r = 114 = 577607 iterations +# l = 108 = 577608 iterations +# d = 100 = 577609 iterations +# ! = 33 = 577610 iterations +# etc. +1067c s:71 e:1 s:577527 s:100 e:1 s:577499 s:107 e:1 s:577493 s:107 e:1 s:577494 s:110 e:1 s:577492 s:31 e:1 s:577572 s:86 e:1 s:577518 s:110 e:1 s:577495 s:113 e:1 s:577493 s:107 e:1 s:577500 s:99 e:1 s:577509 s:32 e:1 s:577577 +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +#106a0 add r3, r3, #1 ; addition +#106a4 str r3, [sp #244] ; store r3 in the stack +106a8 +# +# Base address for cipher: 0x8d040 = 577600 base 10 +# We need 577600 iterations before exiting. r3 starts at 1, we need N-1 +# iterations to create the base address +# For each character, we need to do one iteration more +# It takes around 210 000 000 ticks between a store and reaching the next value for the ASCII char +# It takes around 1 070 000 000 000 ticks between two store +# H = 577599 iterations debug start = 0587160670000 / 1079923570000 (for ASCII val in r2/for store) +# e = 577600 iterations debug start = 1080113753000 / 2159288101000 +# l = 577601 iterations debug start = 2159491159000 / 3238654354000 +# l = 577602 iterations debug start = 3238857643000 / +# o = 577603 iterations debug start = +# = 577604 iterations debug start = +# W = 577605 iterations debug start = +# o = 577606 iterations debug start = +# r = 577607 iterations debug start = +# l = 577608 iterations debug start = +# d = 577609 iterations debug start = +# ! = 577610 iterations debug start = / 12 953 033 522 000 +# FAULT TICK : 12 953 168 116 000 +# Exit just after the printf() : 12 953 150 346 000 +# cmp r3, #9 +# Composed of s+e, where the sum is equal to the number of loop +106ac s:577598 e:1 s:577599 e:1 s:577600 e:1 s:577601 e:1 s:577602 e:1 s:577603 e:1 s:577604 e:1 s:577605 e:1 s:577606 e:1 s:577607 e:1 s:577608 e:1 s:577609 e:1 +# +# +# End of the loop, always execute the branch +#106b0 ble 10628 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +#106e4 # Jump into SubByte() +#106e8 # Cannot be skipped it's the return of the jump (we don't care) +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +## Keep the last 3 instructions +#1072c NOP +#10730 ADD SP +#10734 POP PC +# +# +# +# +# +# SubBytes() here. This function has one purpose: strb r2, [r3]. +# Let the 2 first instructions execute +#1073c SUB SP +#10740 A store in r0 (we don't care) +10744 +10748 +1074c +10750 +10754 +10758 +####### 1075c THE STORE +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +# Keep the last 3 intstructions +#10964 NOP +#10968 ADD SP +#1096c BX LR --> return in SubBytes() diff --git a/tests/test-progs/nops/src/hello/nops-loop.txt b/tests/test-progs/nops/src/hello/nops-loop.txt new file mode 100644 index 0000000000000000000000000000000000000000..22ee0f42a6b5edc955dbbd78e42c3f3a4d4d28c6 --- /dev/null +++ b/tests/test-progs/nops/src/hello/nops-loop.txt @@ -0,0 +1,296 @@ +10528 +# Avoid printf() at each generated char except the last one +105a8 s:11 +# Hijack AESsencrpyt() only 12 times. +1059c e:12 +# keep the 3 first instructions +105cc +105d0 +105d4 +105d8 +105dc +105e0 +105e4 +105e8 +105ec +105f0 +105f4 +105f8 +105fc +10600 +10604 +10608 +1060c +10610 +10614 +10618 +#1061c # Always init r3 to 1 +10620 +10624 +# +# 10628: first instruction in the loop, cannot be skipped (except first round +# to reach the bottom of the loop) +# Composed of s+e, where the sum is the number of loop +10628 s:1 e:577598 s:1 e:577599 s:1 e:577600 s:1 e:577601 s:1 e:577602 s:1 e:577603 s:1 e:577604 s:1 e:577605 s:1 e:577606 s:1 e:577607 s:1 e:577608 s:1 e:577609 +1062c +10630 +# 10634: Get the value of r3 from the stack (except first loop) +# Composed of s+e, where the sum is the number of loop +10634 s:1 e:577598 s:1 e:577599 s:1 e:577600 s:1 e:577601 s:1 e:577602 s:1 e:577603 s:1 e:577604 s:1 e:577605 s:1 e:577606 s:1 e:577607 s:1 e:577608 s:1 e:577609 +# 10638: cmp r2, r3 : need to execute to set LE flag to 1 +# Composed of e+s, where the sum is the number of loop +10638 e:1 s:577598 e:1 s:577599 e:1 s:577600 e:1 s:577601 e:1 s:577602 e:1 s:577603 e:1 s:577604 e:1 s:577605 e:1 s:577606 e:1 s:577607 e:1 s:577608 e:1 s:577609 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +# Skip until value is of char is in r2 then execute once +# Composed of s+e+s, where the sum is equal to the number of loop +# H = 72 = 577999 iterations +# e = 101 = 577600 iterations +# l = 108 = 577601 iterations +# l = 108 = 577602 iterations +# o = 111 = 577603 iterations +# = 32 = 577604 iterations +# W = 87 = 577605 iterations +# o = 111 = 577606 iterations +# r = 114 = 577607 iterations +# l = 108 = 577608 iterations +# d = 100 = 577609 iterations +# ! = 33 = 577610 iterations +# etc. +1067c s:71 e:1 s:577527 s:100 e:1 s:577499 s:107 e:1 s:577493 s:107 e:1 s:577494 s:110 e:1 s:577492 s:31 e:1 s:577572 s:86 e:1 s:577518 s:110 e:1 s:577495 s:113 e:1 s:577493 s:107 e:1 s:577500 s:99 e:1 s:577509 s:32 e:1 s:577577 +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +#106a0 add r3, r3, #1 ; addition +#106a4 str r3, [sp #244] ; store r3 in the stack +106a8 +# +# Base address for cipher: 0x8d040 = 577600 base 10 +# We need 577600 iterations before exiting. r3 starts at 1, we need N-1 +# iterations to create the base address +# For each character, we need to do one iteration more +# It takes around 210 000 000 ticks between a store and reaching the next value for the ASCII char +# It takes around 1 070 000 000 000 ticks between two store +# H = 577599 iterations debug start = 0587160670000 / 1079923570000 (for ASCII val in r2/for store) +# e = 577600 iterations debug start = 1080113753000 / 2159288101000 +# l = 577601 iterations debug start = 2159491159000 / 3238654354000 +# l = 577602 iterations debug start = 3238857643000 / +# o = 577603 iterations debug start = +# = 577604 iterations debug start = +# W = 577605 iterations debug start = +# o = 577606 iterations debug start = +# r = 577607 iterations debug start = +# l = 577608 iterations debug start = +# d = 577609 iterations debug start = +# ! = 577610 iterations debug start = / 12 953 033 522 000 +# FAULT TICK : 12 953 168 116 000 +# Exit just after the printf() : 12 953 150 346 000 +# cmp r3, #9 +# Composed of s+e, where the sum is equal to the number of loop +106ac s:577598 e:1 s:577599 e:1 s:577600 e:1 s:577601 e:1 s:577602 e:1 s:577603 e:1 s:577604 e:1 s:577605 e:1 s:577606 e:1 s:577607 e:1 s:577608 e:1 s:577609 e:1 +# +# +# End of the loop, always execute the branch +#106b0 ble 10628 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +#106e4 # Jump into SubByte() +#106e8 # Cannot be skipped it's the return of the jump (we don't care) +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +## Keep the last 3 instructions +#1072c NOP +#10730 ADD SP +#10734 POP PC +# +# +# +# +# +# SubBytes() here. This function has one purpose: strb r2, [r3]. +# Let the 2 first instructions execute +#1073c SUB SP +#10740 A store in r0 (we don't care) +10744 +10748 +1074c +10750 +10754 +10758 +####### 1075c THE STORE +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +# Keep the last 3 intstructions +#10964 NOP +#10968 ADD SP +#1096c BX LR --> return in SubBytes() diff --git a/tests/test-progs/nops/src/hello/secret.c b/tests/test-progs/nops/src/hello/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..84a4faffe473bf73253f3d6024b6ef83877622bf --- /dev/null +++ b/tests/test-progs/nops/src/hello/secret.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 +#include "aes.h" + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + + while (1) { + AESEncrypt(cipher, plain, key); + printf("%s\n", cipher); + } + return 0; +} diff --git a/tests/test-progs/nops/src/layout/Makefile b/tests/test-progs/nops/src/layout/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..6223a6b2a2c58ab27ad120b5401304f03f4c12f3 --- /dev/null +++ b/tests/test-progs/nops/src/layout/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 -fomit-frame-pointer +OUT=../../bin + +TARGET=secret_layout + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/layout/nops.txt b/tests/test-progs/nops/src/layout/nops.txt new file mode 100644 index 0000000000000000000000000000000000000000..6558d0a6ebe07b390bde386672cc406fa3535072 --- /dev/null +++ b/tests/test-progs/nops/src/layout/nops.txt @@ -0,0 +1,984 @@ +# Entry point +10528 +# Addresses to skip +10544 +10548 +1054c +10550 +10554 +10558 +1055c +10560 +10564 +10568 +1056c +10570 +10574 +10578 +1057c +10580 +10584 +10588 +1058c +10590 +10594 +10598 +1059c +105a0 +105a4 +105a8 +105ac +105b0 +105b4 +105b8 +105bc +105c0 +105c4 +105c8 +105cc +105d0 +105d4 +105d8 +105dc +105e0 +105e4 +105e8 +105ec +105f0 +105f4 +105f8 +105fc +10600 +10604 +10608 +1060c +10610 +10614 +10618 +1061c +10620 +10624 +10628 +1062c +10630 +10634 +10638 +1063c +10640 +10644 +10648 +1064c +10650 +10654 +10658 +1065c +10660 +10664 +10668 +1066c +10670 +10674 +10678 +1067c +10680 +10684 +10688 +1068c +10690 +10694 +10698 +1069c +106a0 +106a4 +106a8 +106ac +106b0 +106b4 +106b8 +106bc +106c0 +106c4 +106c8 +106cc +106d0 +106d4 +106d8 +106dc +106e0 +106e4 +106e8 +106ec +106f0 +106f4 +106f8 +106fc +10700 +10704 +10708 +1070c +10710 +10714 +10718 +1071c +10720 +10724 +10728 +1072c +10730 +10734 +10738 +1073c +10740 +10744 +10748 +1074c +10750 +10754 +10758 +1075c +10760 +10764 +10768 +1076c +10770 +10774 +10778 +1077c +10780 +10784 +10788 +1078c +10790 +10794 +10798 +1079c +107a0 +107a4 +107a8 +107ac +107b0 +107b4 +107b8 +107bc +107c0 +107c4 +107c8 +107cc +107d0 +107d4 +107d8 +107dc +107e0 +107e4 +107e8 +107ec +107f0 +107f4 +107f8 +107fc +10800 +10804 +10808 +1080c +10810 +10814 +10818 +1081c +10820 +10824 +10828 +1082c +10830 +10834 +10838 +1083c +10840 +10844 +10848 +1084c +10850 +10854 +10858 +1085c +10860 +10864 +10868 +1086c +10870 +10874 +10878 +1087c +10880 +10884 +10888 +1088c +10890 +10894 +10898 +1089c +108a0 +108a4 +108a8 +108ac +108b0 +108b4 +108b8 +108bc +108c0 +108c4 +108c8 +108cc +108d0 +108d4 +108d8 +108dc +108e0 +108e4 +108e8 +108ec +108f0 +108f4 +108f8 +108fc +10900 +10904 +10908 +1090c +10910 +10914 +10918 +1091c +10920 +10924 +10928 +1092c +10930 +10934 +10938 +1093c +10940 +10944 +10948 +1094c +10950 +10954 +10958 +1095c +10960 +10964 +10968 +1096c +10970 +10974 +10978 +1097c +10980 +10984 +10988 +1098c +10990 +10994 +10998 +1099c +109a0 +109a4 +109a8 +109ac +109b0 +109b4 +109b8 +109bc +109c0 +109c4 +109c8 +109cc +109d0 +109d4 +109d8 +109dc +109e0 +109e4 +109e8 +109ec +109f0 +109f4 +109f8 +109fc +10a00 +10a04 +10a08 +10a0c +10a10 +10a14 +10a18 +10a1c +10a20 +10a24 +10a28 +10a2c +10a30 +10a34 +10a38 +10a3c +10a40 +10a44 +10a48 +10a4c +10a50 +10a54 +10a58 +10a5c +10a60 +10a64 +10a68 +10a6c +10a70 +10a74 +10a78 +10a7c +10a80 +10a84 +10a88 +10a8c +10a90 +10a94 +10a98 +10a9c +10aa0 +10aa4 +10aa8 +10aac +10ab0 +10ab4 +10ab8 +10abc +10ac0 +10ac4 +10ac8 +10acc +10ad0 +10ad4 +10ad8 +10adc +10ae0 +10ae4 +10ae8 +10aec +10af0 +10af4 +10af8 +10afc +10b00 +10b04 +10b08 +10b0c +10b10 +10b14 +10b18 +10b1c +10b20 +10b24 +10b28 +10b2c +10b30 +10b34 +10b38 +10b3c +10b40 +10b44 +10b48 +10b4c +10b50 +10b54 +10b58 +10b5c +10b60 +10b64 +10b68 +10b6c +10b70 +10b74 +10b78 +10b7c +10b80 +10b84 +10b88 +10b8c +10b90 +10b94 +10b98 +10b9c +10ba0 +10ba4 +10ba8 +10bac +10bb0 +10bb4 +10bb8 +10bbc +10bc0 +10bc4 +10bc8 +10bcc +10bd0 +10bd4 +10bd8 +10bdc +10be0 +10be4 +10be8 +10bec +10bf0 +10bf4 +10bf8 +10bfc +10c00 +10c04 +10c08 +10c0c +10c10 +10c14 +10c18 +10c1c +10c20 +10c24 +10c28 +10c2c +10c30 +10c34 +10c38 +10c3c +10c40 +10c44 +10c48 +10c4c +10c50 +10c54 +10c58 +10c5c +10c60 +10c64 +10c68 +10c6c +10c70 +10c74 +10c78 +10c7c +10c80 +10c84 +10c88 +10c8c +10c90 +10c94 +10c98 +10c9c +10ca0 +10ca4 +10ca8 +10cac +10cb0 +10cb4 +10cb8 +10cbc +10cc0 +10cc4 +10cc8 +10ccc +10cd0 +10cd4 +10cd8 +10cdc +10ce0 +10ce4 +10ce8 +10cec +10cf0 +10cf4 +10cf8 +10cfc +10d00 +10d04 +10d08 +10d0c +10d10 +10d14 +10d18 +10d1c +10d20 +10d24 +10d28 +10d2c +10d30 +10d34 +10d38 +10d3c +10d40 +10d44 +10d48 +10d4c +10d50 +10d54 +10d58 +10d5c +10d60 +10d64 +10d68 +10d6c +10d70 +10d74 +10d78 +10d7c +10d80 +10d84 +10d88 +10d8c +10d90 +10d94 +10d98 +10d9c +10da0 +10da4 +10da8 +10dac +10db0 +10db4 +10db8 +10dbc +10dc0 +10dc4 +10dc8 +10dcc +10dd0 +10dd4 +10dd8 +10ddc +10de0 +10de4 +10de8 +10dec +10df0 +10df4 +10df8 +10dfc +10e00 +10e04 +10e08 +10e0c +10e10 +10e14 +10e18 +10e1c +10e20 +10e24 +10e28 +10e2c +10e30 +10e34 +10e38 +10e3c +10e40 +10e44 +10e48 +10e4c +10e50 +10e54 +10e58 +10e5c +10e60 +10e64 +10e68 +10e6c +10e70 +10e74 +10e78 +10e7c +10e80 +10e84 +10e88 +10e8c +10e90 +10e94 +10e98 +10e9c +10ea0 +10ea4 +10ea8 +10eac +10eb0 +10eb4 +10eb8 +10ebc +10ec0 +10ec4 +10ec8 +10ecc +10ed0 +10ed4 +10ed8 +10edc +10ee0 +10ee4 +10ee8 +10eec +10ef0 +10ef4 +10ef8 +10efc +10f00 +10f04 +10f08 +10f0c +10f10 +10f14 +10f18 +10f1c +10f20 +10f24 +10f28 +10f2c +10f30 +10f34 +10f38 +10f3c +10f40 +10f44 +10f48 +10f4c +10f50 +10f54 +10f58 +10f5c +10f60 +10f64 +10f68 +10f6c +10f70 +10f74 +10f78 +10f7c +10f80 +10f84 +10f88 +10f8c +10f90 +10f94 +10f98 +10f9c +10fa0 +10fa4 +10fa8 +10fac +10fb0 +10fb4 +10fb8 +10fbc +10fc0 +10fc4 +10fc8 +10fcc +10fd0 +10fd4 +10fd8 +10fdc +10fe0 +10fe4 +10fe8 +10fec +10ff0 +10ff4 +10ff8 +10ffc +11000 +11004 +11008 +1100c +11010 +11014 +11018 +1101c +11020 +11024 +11028 +1102c +11030 +11034 +11038 +1103c +11040 +11044 +11048 +1104c +11050 +11054 +11058 +1105c +11060 +11064 +11068 +1106c +11070 +11074 +11078 +1107c +11080 +11084 +11088 +1108c +11090 +11094 +11098 +1109c +110a0 +110a4 +110a8 +110ac +110b0 +110b4 +110b8 +110bc +110c0 +110c4 +110c8 +110cc +110d0 +110d4 +110d8 +110dc +110e0 +110e4 +110e8 +110ec +110f0 +110f4 +110f8 +110fc +11100 +11104 +11108 +1110c +11110 +11114 +11118 +1111c +11120 +11124 +11128 +1112c +11130 +11134 +11138 +1113c +11140 +11144 +11148 +1114c +11150 +11154 +11158 +1115c +11160 +11164 +11168 +1116c +11170 +11174 +11178 +1117c +11180 +11184 +11188 +1118c +11190 +11194 +11198 +1119c +111a0 +111a4 +111a8 +111ac +111b0 +111b4 +111b8 +111bc +111c0 +111c4 +111c8 +111cc +111d0 +111d4 +111d8 +111dc +111e0 +111e4 +111e8 +111ec +111f0 +111f4 +111f8 +111fc +11200 +11204 +11208 +1120c +11210 +11214 +11218 +1121c +11220 +11224 +11228 +1122c +11230 +11234 +11238 +1123c +11240 +11244 +11248 +1124c +11250 +11254 +11258 +1125c +11260 +11264 +11268 +1126c +11270 +11274 +11278 +1127c +11280 +11284 +11288 +1128c +11290 +11294 +11298 +1129c +112a0 +112a4 +112a8 +112ac +112b0 +112b4 +112b8 +112bc +112c0 +112c4 +112c8 +112cc +112d0 +112d4 +112d8 +112dc +112e0 +112e4 +112e8 +112ec +112f0 +112f4 +112f8 +112fc +11300 +11304 +11308 +1130c +11310 +11314 +11318 +1131c +11320 +11324 +11328 +1132c +11330 +11334 +11338 +1133c +11340 +11344 +11348 +1134c +11350 +11354 +11358 +1135c +11360 +11364 +11368 +1136c +11370 +11374 +11378 +1137c +11380 +11384 +11388 +1138c +11390 +11394 +11398 +1139c +113a0 +113a4 +113a8 +113ac +113b0 +113b4 +113b8 +113bc +113c0 +113c4 +113c8 +113cc +113d0 +113d4 +113d8 +113dc +113e0 +113e4 +113e8 +113ec +113f0 +113f4 +113f8 +113fc +11400 +11404 +11408 +1140c +11410 +11414 +11418 +1141c +11420 +11424 +11428 +1142c +11430 +11434 +11438 +1143c +11440 +11444 +11448 +1144c +11450 +11454 +11458 +1145c +11460 +11464 +11468 +1146c +11470 +11474 +11478 +1147c +11480 +11484 +11488 +1148c +11490 +11494 diff --git a/tests/test-progs/nops/src/layout/secret.c b/tests/test-progs/nops/src/layout/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..6d28eb6f59e372914c6ba05bdd9ef39fa830ac38 --- /dev/null +++ b/tests/test-progs/nops/src/layout/secret.c @@ -0,0 +1,472 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 + +// aes.h +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + + +// aes.c +// AES128 encryption +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + + +// AES Round functions +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +// Génération de clé +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill( unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = sboxtab[column[0]] ^ + rcon[round-1] ^ + keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = + sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill( unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + + + +// Other useful functions +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey( unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0] = gmul(column_tmp[0],2) ^ + gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ + gmul(column_tmp[1],3); + column[1] = gmul(column_tmp[0],1) ^ + gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ + gmul(column_tmp[3],1); + column[2] = gmul(column_tmp[0],1) ^ + gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ + gmul(column_tmp[3],3); + column[3] = gmul(column_tmp[0],3) ^ + gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ + gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +// Tables +unsigned char trigger_sel = 1; +const unsigned char rcon [10]={ 0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63,0x7C,0x77,0x7B,0xF2,0x6B,0x6F,0xC5, + 0x30,0x01,0x67,0x2B,0xFE,0xD7,0xAB,0x76, + 0xCA,0x82,0xC9,0x7D,0xFA,0x59,0x47,0xF0, + 0xAD,0xD4,0xA2,0xAF,0x9C,0xA4,0x72,0xC0, + 0xB7,0xFD,0x93,0x26,0x36,0x3F,0xF7,0xCC, + 0x34,0xA5,0xE5,0xF1,0x71,0xD8,0x31,0x15, + 0x04,0xC7,0x23,0xC3,0x18,0x96,0x05,0x9A, + 0x07,0x12,0x80,0xE2,0xEB,0x27,0xB2,0x75, + 0x09,0x83,0x2C,0x1A,0x1B,0x6E,0x5A,0xA0, + 0x52,0x3B,0xD6,0xB3,0x29,0xE3,0x2F,0x84, + 0x53,0xD1,0x00,0xED,0x20,0xFC,0xB1,0x5B, + 0x6A,0xCB,0xBE,0x39,0x4A,0x4C,0x58,0xCF, + 0xD0,0xEF,0xAA,0xFB,0x43,0x4D,0x33,0x85, + 0x45,0xF9,0x02,0x7F,0x50,0x3C,0x9F,0xA8, + 0x51,0xA3,0x40,0x8F,0x92,0x9D,0x38,0xF5, + 0xBC,0xB6,0xDA,0x21,0x10,0xFF,0xF3,0xD2, + 0xCD,0x0C,0x13,0xEC,0x5F,0x97,0x44,0x17, + 0xC4,0xA7,0x7E,0x3D,0x64,0x5D,0x19,0x73, + 0x60,0x81,0x4F,0xDC,0x22,0x2A,0x90,0x88, + 0x46,0xEE,0xB8,0x14,0xDE,0x5E,0x0B,0xDB, + 0xE0,0x32,0x3A,0x0A,0x49,0x06,0x24,0x5C, + 0xC2,0xD3,0xAC,0x62,0x91,0x95,0xE4,0x79, + 0xE7,0xC8,0x37,0x6D,0x8D,0xD5,0x4E,0xA9, + 0x6C,0x56,0xF4,0xEA,0x65,0x7A,0xAE,0x08, + 0xBA,0x78,0x25,0x2E,0x1C,0xA6,0xB4,0xC6, + 0xE8,0xDD,0x74,0x1F,0x4B,0xBD,0x8B,0x8A, + 0x70,0x3E,0xB5,0x66,0x48,0x03,0xF6,0x0E, + 0x61,0x35,0x57,0xB9,0x86,0xC1,0x1D,0x9E, + 0xE1,0xF8,0x98,0x11,0x69,0xD9,0x8E,0x94, + 0x9B,0x1E,0x87,0xE9,0xCE,0x55,0x28,0xDF, + 0x8C,0xA1,0x89,0x0D,0xBF,0xE6,0x42,0x68, + 0x41,0x99,0x2D,0x0F,0xB0,0x54,0xBB,0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E ,0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D}; + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + + AESEncrypt(cipher, plain, key); + printf("%s\n", cipher); + + return 0; +} diff --git a/tests/test-progs/nops/src/naive/Makefile b/tests/test-progs/nops/src/naive/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..aef90b6de53020aeb090a0babf5aa5164c0084b7 --- /dev/null +++ b/tests/test-progs/nops/src/naive/Makefile @@ -0,0 +1,51 @@ +# Copyright (c) 2020, French Institute for Research in Computer Science and +# Automation +# Author: Pierre-Yves Peneau <first.last@inria.fr> +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the <organization> nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PREFIX=arm-linux-gnueabi- +CC=$(PREFIX)gcc +OBJ=$(PREFIX)objdump + +CFLAGS=-fno-builtin -static -O0 +OUT=../../bin + +TARGET=secret_naive + +all: $(TARGET) dump + +$(TARGET): + $(CC) $(CFLAGS) secret.c aes.c -o $(OUT)/$@ + +dump: + $(OBJ) -D $(OUT)/$(TARGET) > $(TARGET).txt + +clean: + rm -f $(OUT)/$(TARGET) + +mrproper: clean + rm -f $(TARGET).txt + diff --git a/tests/test-progs/nops/src/naive/aes.c b/tests/test-progs/nops/src/naive/aes.c new file mode 100644 index 0000000000000000000000000000000000000000..e48146f73c124eb9da807d44d263b1c5e7df925b --- /dev/null +++ b/tests/test-progs/nops/src/naive/aes.c @@ -0,0 +1,417 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + +#include "aes.h" + +//---------------------------------------------------------- +// AES128 encryption +//---------------------------------------------------------- +void AESEncrypt(unsigned char* ciphertext, unsigned char* key, + unsigned char* plaintext) +{ + unsigned char master_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char state [STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char round_key[STATE_ROW_SIZE][STATE_ROW_SIZE]; + unsigned char keys[ROUND_COUNT+1][STATE_ROW_SIZE][STATE_ROW_SIZE]; + int round,i,j; + + //shaping key + MessageToState(master_key, key); + //plaintext to state + MessageToState(state, plaintext); + //key generation + KeyGen(keys, master_key); + + + // xor key + AddRoundKey( state, master_key); + + + for (round=1;round<ROUND_COUNT;round++) + { + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + // MC + MixColumns(state); + + // xor key + GetRoundKey(round_key,keys,round); + AddRoundKey( state, round_key); + } + + + // SB + if (trigger_sel == round) { + SubBytes(state); + } else { + SubBytes(state); + } + + // SR + ShiftRows(state); + + // xor key + GetRoundKey(round_key,keys,ROUND_COUNT); + AddRoundKey( state, round_key); + + //ecriture du message en ligne + StateToMessage(ciphertext,state); + + return; + +} + +//---------------------------------------------------------- +// AES Round functions +//---------------------------------------------------------- +void SubBytes(unsigned char state[][STATE_ROW_SIZE]) +{ + state[0][0]=sboxtab[state[0][0]]; + state[0][1]=sboxtab[state[0][1]]; + state[0][2]=sboxtab[state[0][2]]; + state[0][3]=sboxtab[state[0][3]]; + + state[1][0]=sboxtab[state[1][0]]; + state[1][1]=sboxtab[state[1][1]]; + state[1][2]=sboxtab[state[1][2]]; + state[1][3]=sboxtab[state[1][3]]; + + state[2][0]=sboxtab[state[2][0]]; + state[2][1]=sboxtab[state[2][1]]; + state[2][2]=sboxtab[state[2][2]]; + state[2][3]=sboxtab[state[2][3]]; + + state[3][0]=sboxtab[state[3][0]]; + state[3][1]=sboxtab[state[3][1]]; + state[3][2]=sboxtab[state[3][2]]; + state[3][3]=sboxtab[state[3][3]]; +} + + +// fonction SR +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]) +{ + unsigned char temp; + //shif row 0 do nothing + + //shift row 1 + temp = state[1][0]; + state[1][0]= state[1][1]; + state[1][1]= state[1][2]; + state[1][2]= state[1][3]; + state[1][3]= temp; + + //shift row 2 + temp = state[2][0]; + state[2][0]= state[2][2]; + state[2][2]= temp; + temp = state[2][1]; + state[2][1]= state[2][3]; + state[2][3]= temp; + + //shift row 3 + temp = state[3][0]; + state[3][0]= state[3][3]; + state[3][3]= state[3][2]; + state[3][2]= state[3][1]; + state[3][1]= temp; + + return; + +} + +// fonction MC +void MixColumns(unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + unsigned char column [STATE_ROW_SIZE]; + for (j=0;j<STATE_ROW_SIZE;j++) + { + for (i=0;i<STATE_ROW_SIZE;i++) + { + column[i]=state[i][j]; + } + + MCMatrixColumnProduct(column); + + for (i=0;i<STATE_ROW_SIZE;i++) + { + state[i][j]=column[i]; + } + } + + return; +} + + +//---------------------------------------------------------- +// Génération de clé +//---------------------------------------------------------- +// round keys generation +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]) +{ + int round,row,col; + int i,j,k; + + + for (row=0;row<STATE_ROW_SIZE;row++) + { + for (col=0;col<STATE_ROW_SIZE;col++) + { + keys[0][row][col]=master_key[row][col]; + } + } + + for (round=1;round<ROUND_COUNT+1;round++) + { + ColumnFill(keys,round); + OtherColumnsFill(keys,round); + } + + return; +} + +//Creation of first column of a round key +void ColumnFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE],int round) +{ + int i; + unsigned char column [STATE_ROW_SIZE]; + //rotate + column[0]=keys[round-1][1][3]; + column[1]=keys[round-1][2][3]; + column[2]=keys[round-1][3][3]; + column[3]=keys[round-1][0][3]; + + + //sbox + rcon + xor + keys[round][0][0] = + sboxtab[column[0]] ^ rcon[round-1] ^ keys[round-1][0][0]; + for (i=1;i<STATE_ROW_SIZE;i++) + { + keys[round][i][0] = sboxtab[column[i]] ^ keys[round-1][i][0]; + } + return; +} + +//Creation of other round key columns +void OtherColumnsFill(unsigned char keys[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round) +{ + int row,col; + for (col=1;col<STATE_ROW_SIZE;col++) //column 1 to 3 + { + for (row=0;row<STATE_ROW_SIZE;row++) + { + keys[round][row][col] = + keys[round-1][row][col] ^ keys[round][row][col-1]; + } + } + + return; +} + +//Get selected round key +void GetRoundKey(unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + round_key[i][j]=keys[round][i][j]; + } + } + return; +} + +//---------------------------------------------------------- +// Other useful functions +//---------------------------------------------------------- +// Transform a vector into a state matrix +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + state[i][j]=message[j*STATE_ROW_SIZE+i]; + } + } + return; +} + +// Transform a state matrix into a vector +void StateToMessage(unsigned char message[], + unsigned char state [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + message[j*STATE_ROW_SIZE+i]=state[i][j]; + } + } + return; +} + + + +//for each element arr1[i] = arr1[i] xor arr2[i] +void AddRoundKey(unsigned char arr1 [][STATE_ROW_SIZE], + unsigned char arr2 [][STATE_ROW_SIZE]) +{ + int i,j; + for (i=0;i<STATE_ROW_SIZE;i++) + { + for (j=0;j<STATE_ROW_SIZE;j++) + { + arr1[i][j] = arr1[i][j] ^ arr2[i][j]; + } + } + return; +} + + +//MC Matrix product (see specs) +void MCMatrixColumnProduct(unsigned char column []) +{ + int i; + unsigned char column_tmp [STATE_ROW_SIZE]; + //copy column + for (i=0; i<STATE_ROW_SIZE; i++) { + column_tmp[i] = column[i]; + } + + column[0]= gmul(column_tmp[0],2) ^ gmul(column_tmp[3],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[1],3); + column[1]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],2) ^ + gmul(column_tmp[2],3) ^ gmul(column_tmp[3],1); + column[2]= gmul(column_tmp[0],1) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],2) ^ gmul(column_tmp[3],3); + column[3]= gmul(column_tmp[0],3) ^ gmul(column_tmp[1],1) ^ + gmul(column_tmp[2],1) ^ gmul(column_tmp[3],2); + + return; +} + +//Galois field product +unsigned char gmul(unsigned char a, unsigned char b) +{ + unsigned char p = 0; + unsigned char beacon = 0; + unsigned char counter, hi_bit_set; + for (counter = 0; counter < 8; counter++) + { + if ((b & 1) == 1) + p ^= a; + else + beacon ^= a; + + + hi_bit_set = (a & 0x80); + a <<= 1; + if (hi_bit_set == 0x80) + a ^= 0x1b; + else + beacon ^= 0x1b; + + b >>= 1; + } + return p; +} + + +//---------------------------------------------------------- +// Tables +//---------------------------------------------------------- +unsigned char trigger_sel = 1; + +const unsigned char rcon [10]={0x01 , 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +const unsigned char sboxtab [256]={ + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, + 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, + 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, + 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, + 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, + 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, + 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, + 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, + 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, + 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, + 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, + 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, + 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, + 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; + + +const unsigned char invsbox [256]={ + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, + 0xBF, 0x40, 0xA3, 0x9E, 0X81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, + 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, + 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, + 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, + 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, + 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, + 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, + 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, + 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, + 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, + 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, + 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, + 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, + 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, + 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D }; diff --git a/tests/test-progs/nops/src/naive/aes.h b/tests/test-progs/nops/src/naive/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..9239b7775e2136a0c25be7bff8280bb49f412bbe --- /dev/null +++ b/tests/test-progs/nops/src/naive/aes.h @@ -0,0 +1,52 @@ +/** +* @Author: hélène, ronan +* @Date: 12-09-2016 +* @Email: helene.lebouder@inri.fr, ronan.lashermes@inria.fr +* @Last modified by: ronan +* @Last modified time: 19-09-2016 +* @License: GPL +*/ + + + +#ifndef AES_H +#define AES_H + +#define DATA_SIZE 16 +#define STATE_ROW_SIZE 4 +#define ROUND_COUNT 10 + + +void AESEncrypt(unsigned char* ciphertext, unsigned char* plaintext, + unsigned char* key); + +void AddRoundKey( unsigned char tableau_1 [][STATE_ROW_SIZE], + unsigned char tableau_2 [][STATE_ROW_SIZE]); +void SubBytes(unsigned char state[][STATE_ROW_SIZE]); +void ShiftRows(unsigned char state[][STATE_ROW_SIZE]); +void MixColumns(unsigned char state [][STATE_ROW_SIZE]); + +void KeyGen(unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], + unsigned char master_key [][STATE_ROW_SIZE]); +void ColumnFill( unsigned char cle[][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void OtherColumnsFill( unsigned char cle [][STATE_ROW_SIZE][STATE_ROW_SIZE], + int round); +void GetRoundKey( unsigned char round_key [][STATE_ROW_SIZE], + unsigned char keys [][STATE_ROW_SIZE][STATE_ROW_SIZE], int round); + +void MessageToState(unsigned char state [][STATE_ROW_SIZE], + unsigned char message []); +void StateToMessage(unsigned char message [], + unsigned char state [][STATE_ROW_SIZE]); +void MCMatrixColumnProduct(unsigned char colonne []); +unsigned char gmul(unsigned char a, unsigned char b); + +extern const unsigned char rcon [10]; + +extern const unsigned char sboxtab [256]; +extern const unsigned char invsbox [256]; + +extern unsigned char trigger_sel; + +#endif diff --git a/tests/test-progs/nops/src/naive/nops.txt b/tests/test-progs/nops/src/naive/nops.txt new file mode 100644 index 0000000000000000000000000000000000000000..b84fab3db572d77f6d545aab6938f824dee1a75c --- /dev/null +++ b/tests/test-progs/nops/src/naive/nops.txt @@ -0,0 +1,5 @@ +# Entry point +10528 +# Addresses to skip +105a0 +105a4 diff --git a/tests/test-progs/nops/src/naive/secret.c b/tests/test-progs/nops/src/naive/secret.c new file mode 100644 index 0000000000000000000000000000000000000000..ab052bf0f53da0f8ad69fef282b708dc92345f6d --- /dev/null +++ b/tests/test-progs/nops/src/naive/secret.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020, French Institute for Research in Computer Science and + * Automation + * Author: Pierre-Yves Peneau <first.last@inria.fr> + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the <organization> nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define BUF_SIZE 16 +#include "aes.h" + +int +main() { + + unsigned char* plain = malloc(BUF_SIZE*sizeof(char)); + unsigned char* cipher = malloc(BUF_SIZE*sizeof(char)); + unsigned char* key = malloc(BUF_SIZE*sizeof(char)); + + memset(cipher, 0, BUF_SIZE); + sprintf(plain, "%s", "thisisaplaintext"); + sprintf(key, "%s", "0123456789ABCDEF"); + AESEncrypt(cipher, key, plain); + printf("%s\n", cipher); + + return 0; +}