Last active
April 9, 2018 09:13
-
-
Save HAOYUatHZ/23e057de84b259929ff115a099152420 to your computer and use it in GitHub Desktop.
MulMat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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