projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
key getattr
[u/mdw/catacomb]
/
README.mp
diff --git
a/README.mp
b/README.mp
index
bc75817
..
63bcbed
100644
(file)
--- a/
README.mp
+++ b/
README.mp
@@
-129,7
+129,7
@@
The high-level interface
happens is that a reference is lost to whatever the destination
used to refer to, and a reference to the new result is gained.
The address might be different, and then again it might not.
happens is that a reference is lost to whatever the destination
used to refer to, and a reference to the new result is gained.
The address might be different, and then again it might not.
- Destinations
ac
n be the same as sources -- that works fine.
+ Destinations
ca
n be the same as sources -- that works fine.
Finally, there's the magic value `MP_NEW'. MP_NEW is a special
constant which, as a destination, means `create a new place and
put the answer there'.
Finally, there's the magic value `MP_NEW'. MP_NEW is a special
constant which, as a destination, means `create a new place and
put the answer there'.
@@
-163,10
+163,10
@@
The high-level interface
Multiply y by z, putting the result in x, but making y
no longer useful.
Multiply y by z, putting the result in x, but making y
no longer useful.
- Here
's
some examples of how to do it wrong:
+ Here
are
some examples of how to do it wrong:
mp_mul(y, y, z);
mp_mul(y, y, z);
- mp_mul might choose somewhere other than
b
's storage to
+ mp_mul might choose somewhere other than
y
's storage to
write its result. (In fact, the current version
certainly will.) So y is trashed because there are no
references to it any more, and the result of the
write its result. (In fact, the current version
certainly will.) So y is trashed because there are no
references to it any more, and the result of the
@@
-263,8
+263,8
@@
Modular multiplication and exponentiation
mpmont mm;
mp *ar, *br, *p;
mpmont_create(&mm, m);
mpmont mm;
mp *ar, *br, *p;
mpmont_create(&mm, m);
- ar = mp
_mul(MP_NEW, a, m.r2);
/* aR mod m */
- br = mp
_mul(MP_NEW, b, m.r2);
/* bR mod m */
+ ar = mp
mont_mul(MP_NEW, a, m.r2);
/* aR mod m */
+ br = mp
mont_mul(MP_NEW, b, m.r2);
/* bR mod m */
p = mpmont_mul(&mm, MP_NEW, ar, br); /* abR mod m */
p = mpmont_reduce(&mm, p, p); /* ab mod m */
mpmont_destroy(&mm);
p = mpmont_mul(&mm, MP_NEW, ar, br); /* abR mod m */
p = mpmont_reduce(&mm, p, p); /* ab mod m */
mpmont_destroy(&mm);
@@
-319,16
+319,16
@@
Modular multiplication and exponentiation
Finding prime numbers
Prime numbers are important too. Finding them is not ever-so
Finding prime numbers
Prime numbers are important too. Finding them is not ever-so
- easy. T
H
ere's a huge variety of useful properties which are
+ easy. T
h
ere's a huge variety of useful properties which are
needed, and it's basically impossible to cover everything.
Catacomb has two useful facilities. There's a fast sequential-
needed, and it's basically impossible to cover everything.
Catacomb has two useful facilities. There's a fast sequential-
- search filtering system called `pfilt, and a good (but
+ search filtering system called `pfilt
'
, and a good (but
probabilistic) primality tester which implements the Rabin-
Miller test.
probabilistic) primality tester which implements the Rabin-
Miller test.
- Over the top of this is a confgurable plug-in-appropriate-bits
- system called `pgen' which tie
d
everything together. You're
+ Over the top of this is a conf
i
gurable plug-in-appropriate-bits
+ system called `pgen' which tie
s
everything together. You're
much better off using `pgen' than grovelling about with the
filter and Rabin-Miller tests by hand. The low-level details
are much better used to create new `pgen' components.
much better off using `pgen' than grovelling about with the
filter and Rabin-Miller tests by hand. The low-level details
are much better used to create new `pgen' components.
@@
-340,8
+340,7
@@
Conclusion
maths library. I hope it's provided enough background that the
comments start making sense.
maths library. I hope it's provided enough background that the
comments start making sense.
---
-[mdw]
+-- [mdw]
\f
Local variables:
\f
Local variables: