Ejemplo n.º 1
0
void galois_w32_region_xor(void *src, void *dest, int nbytes)
{
  if (gfp_array[32] == NULL) {
    galois_init(32);
  }
  gfp_array[32]->multiply_region.w32(gfp_array[32], src, dest, 1, nbytes, 1);
}
Ejemplo n.º 2
0
void galois_w16_region_xor(void *src, void *dest, int nbytes)
{
  if (gfp_array[16] == NULL) {
    galois_init(16);
  }
  gfp_array[16]->multiply_region.w32(gfp_array[16], src, dest, 1, nbytes, 1);
}
Ejemplo n.º 3
0
void galois_w32_region_multiply(char *region,      /* Region to multiply */
                                  int multby,       /* Number to multiply by */
                                  int nbytes,        /* Number of bytes in region */
                                  char *r2,          /* If r2 != NULL, products go here */
                                  int add)
{
  if (gfp_array[32] == NULL) {
    galois_init(32);
  }
  gfp_array[32]->multiply_region.w32(gfp_array[32], region, r2, multby, nbytes, add);
}
Ejemplo n.º 4
0
int galois_single_multiply(int x, int y, int w)
{
  if (x == 0 || y == 0) return 0;
  
  if (gfp_array[w] == NULL) {
    galois_init(w);
  }

  if (w <= 32) {
    return gfp_array[w]->multiply.w32(gfp_array[w], x, y);
  } else {
    fprintf(stderr, "ERROR -- Galois field not implemented for w=%d\n", w);
    return 0;
  }
}
Ejemplo n.º 5
0
void kuz_init()
{
#if(!USE_ASM)
    
#if(USE_GALOIS)
    galois_init();
#endif
    
#if(USE_MUL_TABLE)
    generate_mul_table();
#endif
    
#if(USE_TABLES)
    generate_table(kuz_pil_enc128, generate_pil_enc128);
    generate_table(kuz_l_dec128, generate_l_dec128);
    generate_table(kuz_pil_dec128, generate_pil_dec128);
#endif
    
#endif

    calc_used_memory_count();
}