Algorithmic Cryptanalysis

External Links

  • Libraries & Programs
  • Readings
  • IACR
  • Cryptographer's world
  • CRC Press
  • Book on CRC Press
  • Author's home page
  • Other Links
Thu Jul 25 11:23:17 2024

Algorithmic Cryptanalysis (View it on

A CRC Press Book by Antoine Joux

Program 3.7: Elementary matrix multiplication over GF(p)

Creative Commons License
Algorithmic cryptanalysis codes by Antoine Joux are licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
#include <stdio.h>
#include <stdlib.h>

#define TYPE unsigned short
#define MODULO 46337 /* Also works with primes up to 65521*/
#define access(M,i,j,size) M[(i)+((j)*(size))]

void matmul(TYPE * A, TYPE * B, TYPE *Res, int size) {

  int i,j,k;
  unsigned int tmp;
    for(j=0;j<size;j++) {

      for(k=0;k<size;k++) {



Credits for page styles: Dynamic Drive CSS Library