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

bn/asm/x86_64-mont5.pl: fix valgrind error.

bn_get_bits5 was overstepping array boundary by 1 byte. It was exclusively
read overstep and data could not have been used. The only potential problem
would be if array happens to end on the very edge of last accesible page.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 86e5d1e3
...@@ -3231,11 +3231,16 @@ $code.=<<___; ...@@ -3231,11 +3231,16 @@ $code.=<<___;
.type bn_get_bits5,\@abi-omnipotent .type bn_get_bits5,\@abi-omnipotent
.align 16 .align 16
bn_get_bits5: bn_get_bits5:
mov $inp,%r10 lea 0($inp),%r10
lea 1($inp),%r11
mov $num,%ecx mov $num,%ecx
shr \$3,$num shr \$4,$num
movzw (%r10,$num),%eax and \$15,%ecx
and \$7,%ecx lea -8(%ecx),%eax
cmp \$11,%ecx
cmova %r11,%r10
cmova %eax,%ecx
movzw (%r10,$num,2),%eax
shrl %cl,%eax shrl %cl,%eax
and \$31,%eax and \$31,%eax
ret ret
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册