-prog_uint8_t ntt_test_values_in[16] = {
- 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
- 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
-};
-
-prog_uint8_t ntt_test_values_out[16] = {
- 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73,
- 0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43
-};
-/* memcmp_P() is now implemented in avr-libc
-int memcmp_P(const void *s1, PGM_P s2, size_t n){
- uint8_t b;
- while(n--){
- b = pgm_read_byte_near(s2);
- if( *((uint8_t*)s1) != b)
- return(*((uint8_t*)s1)-b);
- ++s1; ++s2;
- }
- return 0;
-}
-*/
-void testrun_camellia(void){
- /* we run the NESSIE test for Camellia here see
- * https://www.cosic.esat.kuleuven.be/nessie/testvectors/bc/camellia/Camellia-128-128.verified.test-vectors
- * for the vectors
- */
- unsigned j, setn;
- uint8_t block[16];
- uint8_t key[16];
- memcpy_P(block, ntt_test_values_in, 16);
- memcpy_P(key, ntt_test_values_in, 16);
- test_encrypt(block, key, 128, true);
- if(memcmp_P(block, ntt_test_values_out, 16)){
- uart_putstr("\t[FAILED]\r\n");
- return;
- }
- uart_putstr("\t[OK]");
- test_decrypt(block, key, 128, true);
- if(memcmp_P(block, ntt_test_values_in, 16)){
- uart_putstr("\t[FAILED]\r\n");
- return;
- }
- uart_putstr("\t[OK]");