Skip to content

Instantly share code, notes, and snippets.

@HAOYUatHZ
Last active April 9, 2018 09:13
Show Gist options
  • Save HAOYUatHZ/23e057de84b259929ff115a099152420 to your computer and use it in GitHub Desktop.
Save HAOYUatHZ/23e057de84b259929ff115a099152420 to your computer and use it in GitHub Desktop.
MulMat
void mul(const Mat256x256i8& a, const Mat256x256i8& b) {
for(int i=0; i<256; i++) {
for(int j=0; j<256; j++) {
int tmp=0;
for(int k=0; k<256; k++) {
tmp+=int(a.d[i][k])*int(b.d[k][j]);
}
this->d[i][j]=((tmp&0xFF)+ ((tmp>>8)&0xFF))&0xFF;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment