summaryrefslogtreecommitdiffstats
path: root/crypto/bn/asm/vms.mar
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-12-01 02:17:23 +0000
committerRichard Levitte <levitte@openssl.org>2002-12-01 02:17:23 +0000
commit0f995b2f40f6d5033c03c676627c3b179c2e0482 (patch)
tree06347e9f504daeeec79ef9e2743e4feb48382835 /crypto/bn/asm/vms.mar
parent848f735ae4d391fdffef4f926d70b0e9bf5f50c0 (diff)
Small bugfix: even when r == d, we need to adjust r and q.
PR: 366
Diffstat (limited to 'crypto/bn/asm/vms.mar')
-rw-r--r--crypto/bn/asm/vms.mar22
1 files changed, 11 insertions, 11 deletions
diff --git a/crypto/bn/asm/vms.mar b/crypto/bn/asm/vms.mar
index 6bd0e87a9a..a2ac41a556 100644
--- a/crypto/bn/asm/vms.mar
+++ b/crypto/bn/asm/vms.mar
@@ -202,7 +202,7 @@ n=12 ;(AP) n by value (input)
; r = r - d
; q = q + 1
; }
-; while (r > d)
+; while (r >= d)
; {
; r = r - d
; q = q + 1
@@ -253,21 +253,21 @@ d=12 ;(AP) d by value (input)
3$:
tstl r3
bgeq 4$
- incl r6 ; since the high bit in r is set, set rprim
+ incl r6 ; since the high bit in r is set, set r'
4$:
- ashl #1,r2,r2
- ashl #1,r3,r3
- addl r5,r3
+ ashl #1,r2,r2 ; q = q << 1
+ ashl #1,r3,r3 ; r = r << 1
+ addl r5,r3 ; r = r + a'
tstl r6
- beql 5$
- subl r4,r3
- incl r2
+ beql 5$ ; if r'
+ subl r4,r3 ; r = r - d
+ incl r2 ; q = q + 1
5$:
cmpl r3,r4
- blequ 42$
- subl r4,r3
- incl r2
+ blssu 42$ ; while r >= d
+ subl r4,r3 ; r = r - d
+ incl r2 ; q = q + 1
brb 5$
42$:
; movl r3,r1