[Vm-dev] VM Maker: VMMaker-dtl.239.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Sat Jun 4 15:31:48 UTC 2011


Dave Lewis uploaded a new version of VMMaker to project VM Maker:
http://www.squeaksource.com/VMMaker/VMMaker-dtl.239.mcz

==================== Summary ====================

Name: VMMaker-dtl.239
Author: dtl
Time: 4 June 2011, 9:14:01 am
UUID: f6723d2a-3330-4c50-965a-eae7f1af5c1e
Ancestors: VMMaker-dtl.238

VMMaker 4.5.3

Montgomery multiplication bug fix from <http://lists.squeakfoundation.org/pipermail/vm-dev/2011-June/008350.html>

Date: Sat, 4 Jun 2011 00:29:37 +0200
From: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
To: Squeak Virtual Machine Development Discussion <vm-dev at lists.squeakfoundation.org>
Subject: [Vm-dev] BUG in Montgomery multiplication

Recent addition, montgomery multiplication, has a bug:
it fails to correctly take last carry into account...

You can see it with this example (if you have the Smalltalk mock up) :

| m mInv a b |
m := 15485863.
mInv := 256 - ((m bitAnd: 255) reciprocalModulo: 256).
a := 8826019 digitMontgomeryTimes: 8826019 modulo: m mInvModB: mInv.
b := 8826019 naiveMontgomeryTimes: 8826019 modulo: m mInvModB: mInv.
self assert: a = b

Correct result is given by naive mock up : 10626344
The primitive gives a wrong result.

I attach a correction for the LargeInteger plugin (and for the
Smalltalk mock up too).

Sorry for uncomplete tests.
Please, update VMMaker ASAP.

Nicolas



More information about the Vm-dev mailing list