describe this code
-
hi this code is a part of keecak function. i do not undrastand what is "C[index(x-xOff)];" plz help me;
template<class Lane>
void KeccakF::inverseTheta(vector<Lane>& A) const
{
vector<Lane> C(5);
for(unsigned int x=0; x<5; x++) {
= A[index(x,0)];
for(unsigned int y=1; y<5; y++){
^= A[index(x,y)];
}
}
const LaneValue inversePositions64[5] = {
0xDE26BC4D789AF134ULL,
0x09AF135E26BC4D78ULL,
0xEBC4D789AF135E26ULL,
0x7135E26BC4D789AFULL,
0xCD789AF135E26BC4ULL };
vector<LaneValue> inversePositions(5, 0);
for(unsigned int z=0; z<64; z+=laneSize)
for(unsigned int x=0; x<5; x++)
^= inversePositions64[x] >> z;
for(unsigned int z=0; z<laneSize; z++) {
for(unsigned int xOff=0; xOff<5; xOff++)
for(int x=0; x<5; x++)
for(unsigned int y=0; y<5; y++)
if ((inversePositions[xOff] & 1) != 0)
A[index(x, y)] ^= C[index(x-xOff)];
for(unsigned int xOff=0; xOff<5; xOff++) {
ROL(C[xOff], 1);
inversePositions[xOff] >>= 1;
}
}
} -
hi this code is a part of keecak function. i do not undrastand what is "C[index(x-xOff)];" plz help me;
template<class Lane>
void KeccakF::inverseTheta(vector<Lane>& A) const
{
vector<Lane> C(5);
for(unsigned int x=0; x<5; x++) {
= A[index(x,0)];
for(unsigned int y=1; y<5; y++){
^= A[index(x,y)];
}
}
const LaneValue inversePositions64[5] = {
0xDE26BC4D789AF134ULL,
0x09AF135E26BC4D78ULL,
0xEBC4D789AF135E26ULL,
0x7135E26BC4D789AFULL,
0xCD789AF135E26BC4ULL };
vector<LaneValue> inversePositions(5, 0);
for(unsigned int z=0; z<64; z+=laneSize)
for(unsigned int x=0; x<5; x++)
^= inversePositions64[x] >> z;
for(unsigned int z=0; z<laneSize; z++) {
for(unsigned int xOff=0; xOff<5; xOff++)
for(int x=0; x<5; x++)
for(unsigned int y=0; y<5; y++)
if ((inversePositions[xOff] & 1) != 0)
A[index(x, y)] ^= C[index(x-xOff)];
for(unsigned int xOff=0; xOff<5; xOff++) {
ROL(C[xOff], 1);
inversePositions[xOff] >>= 1;
}
}
} -
hi this code is a part of keecak function. i do not undrastand what is "C[index(x-xOff)];" plz help me;
template<class Lane>
void KeccakF::inverseTheta(vector<Lane>& A) const
{
vector<Lane> C(5);
for(unsigned int x=0; x<5; x++) {
= A[index(x,0)];
for(unsigned int y=1; y<5; y++){
^= A[index(x,y)];
}
}
const LaneValue inversePositions64[5] = {
0xDE26BC4D789AF134ULL,
0x09AF135E26BC4D78ULL,
0xEBC4D789AF135E26ULL,
0x7135E26BC4D789AFULL,
0xCD789AF135E26BC4ULL };
vector<LaneValue> inversePositions(5, 0);
for(unsigned int z=0; z<64; z+=laneSize)
for(unsigned int x=0; x<5; x++)
^= inversePositions64[x] >> z;
for(unsigned int z=0; z<laneSize; z++) {
for(unsigned int xOff=0; xOff<5; xOff++)
for(int x=0; x<5; x++)
for(unsigned int y=0; y<5; y++)
if ((inversePositions[xOff] & 1) != 0)
A[index(x, y)] ^= C[index(x-xOff)];
for(unsigned int xOff=0; xOff<5; xOff++) {
ROL(C[xOff], 1);
inversePositions[xOff] >>= 1;
}
}
}mostafaghanei wrote:
this code is a part of keecak function
Ahh, Keecak eh? Yes, that's very well known. I am sure someone can tell you what it does.
"The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold