On Arm, C is a true carry flag, unlike x86 where CF is a borrow flag for
subtraction. That is, for subtraction, it is set if Rn + ~Rm + 1 carries
in unsigned arithmetic, and so for subtracting 0, i.e. adding ~0 + 1, it
always sets the carry flag. Correct the comment to document what this is
actually doing.
CLA: trivial
Fixes: d1671f4f1a39 ("bn/asm/armv4-mont.pl: add NEON code path.")
Fixes: 10646160125a ("Optimize RSA on armv8")
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27826)
vst1.32 {${temp}[0]}, [$toutptr, :32] @ top-most bit
sub $nptr,$nptr,$num,lsl#2 @ rewind $nptr
- subs $aptr,sp,#0 @ clear carry flag
+ subs $aptr,sp,#0 @ set carry flag
add $bptr,sp,$num,lsl#2
.LNEON_sub:
st1 {$temp.s}[0], [$toutptr],#4 // top-most bit
sub $nptr,$nptr,$num,lsl#2 // rewind $nptr
- subs $aptr,sp,#0 // clear carry flag
+ subs $aptr,sp,#0 // set carry flag
add $bptr,sp,$num,lsl#2
.LNEON_sub: