![](https://csdnimg.cn/release/download_crawler_static/87942050/bgc.jpg)
for ( i = 0; i < counter; i++ )
{
wMiddle = ((wSubSeed & 0x20000000) / 0x20000000) ^ ((wSubSeed &
0x01000000) / 0x01000000)
^ ((wSubSeed & 0x2000) / 0x2000) ^ ((wSubSeed & 0x08) / 0x08);
wLastBit = (wMiddle & 0x00000001) ;
wSubSeed = (uint32)(wSubSeed << 1);
wLeft31Bits = (uint32)(wSubSeed & 0xFFFFFFFE);
wSubSeed = (uint32)(wLeft31Bits | wLastBit);
}
if (mask & 0x00000002)
{
wLeft31Bits = ((wSubSeed & 0x00FF0000) >> 8) |
((wSubSeed & 0xFF000000) >> 24) |
((wSubSeed & 0x000000FF) << 16) |
((wSubSeed & 0x0000FF00) << 16);
}
else
{
wLeft31Bits = wSubSeed;
}
*key = wLeft31Bits ^ mask;
return SECM_OK;
}