提交 c943ca54 编写于 作者: A Andy Polyakov

Optimize OPENSSL_cleanse.

上级 1c7f8707
......@@ -64,12 +64,13 @@ unsigned char cleanse_ctr = 0;
void OPENSSL_cleanse(void *ptr, size_t len)
{
unsigned char *p = ptr;
size_t loop = len;
size_t loop = len, ctr = cleanse_ctr;
while(loop--)
{
*(p++) = cleanse_ctr;
cleanse_ctr += (17 + (unsigned char)((unsigned long)p & 0xF));
*(p++) = (unsigned char)ctr;
ctr += (17 + ((size_t)p & 0xF));
}
if(memchr(ptr, cleanse_ctr, len))
cleanse_ctr += 63;
if(p=memchr(ptr, (unsigned char)ctr, len))
ctr += (63 + (size_t)p);
cleanse_ctr = (unsigned char)ctr;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册