#include "memxor.h"
#include "mqq160-sign.h"
-static uint8_t mod20_table[32] PROGMEM = {
+static const uint8_t mod20_table[32] PROGMEM = {
4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19,
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
};
-static void memxor_P(void* dest, const void* src, uint16_t length){
- while(length--){
- *((uint8_t*)dest) ^= pgm_read_byte(src);
- dest = (uint8_t*)dest +1;
- src = (uint8_t*)src +1;
- }
-}
-
static void memxor_idx_P(uint8_t* dest, const uint8_t* src, uint16_t length, uint8_t dist){
while(length--){
*((uint8_t*)dest) ^= pgm_read_byte((uint8_t*)src);
static void mqq_inv_affine_transformation(uint8_t* input_bytes, uint8_t* result, const mqq160_sign_key_t* key){
/* The matrix SInv is given as two permutations of 160 elements. */
uint8_t j, byteindex, bitindex, bitindex_d, byteindex_d, rp1, rp5;
- uint8_t *r1_ptr, *r5_ptr;
+ const uint8_t *r1_ptr, *r5_ptr;
uint8_t h1[20];
/* Initialize H1 and H2 = 0 */
uint8_t result, column, row, k;
int8_t j;
uint16_t temp;
- uint8_t *tmp_ptr=key->a;
+ const uint8_t *tmp_ptr=key->a;
if(i&1){
memcpy_P(e, key->cc1, 9);
while(b1){