Hi Marcel,
No, it needs to be a 1024-bit prime P =3D 2*Q+1 with Q also prime. We =
want a maximal length subgroup of length P-1 so that we don't get =
trapped in a short-cycle subgroup a you would if Q were composite. P =
itself must be prime or the SRP-6 (which is using a variant of =
Diffie-Hellman) won't work properly. So if P is 1024 bits then Q is 1023 =
bits, right?
Miller-Rabin is a good start, but it is not definitive. You also need to =
test with a probabilistic Lucas test, which tests for the probability =
that a number is composite -- goes the other way from Miller-Rabin, see?
And you need Bignum modulo arithmetic, conversion from strings to =
numeric bytes in the SHA256 hashings (not a problem for Forth, eh? I =
have to do an explicit conversion in Lisp because characters are most =
likely 32-bit composite objects, or 16-bit Unicode at the very least, or =
maybe UTF-8, your choice...)
So, floating point is out. You need multi-byte or multi-word arithmetic =
to pull this off. You can do it! Sure you can in Forth! Really! But it =
may take you a while. Then too, I didn't specify how this information =
gets sent across the network. In Butterfly's case it is serialized (aka =
Marshaled) and retains whatever data type it is. In your case you could =
be as blunt as text transfer, or even fixed-length binary. I don't care.=20=
But unless you happen to have all the parts already laying about, my =
hunch is that it is going to take you a little longer than an hour or =
so... In Lisp, no problem. Numbers (integers) can be as many digits as =
you like, and they expand on demand. Don't even think twice about it. =
It's built-in.
So that Bignum arithmetic, plus the need for platform independence, plus =
the need for a "portable dialect" (heh!) of Forth, probably is gonna =
stop you in your track pretty quickly.
Forth can't be standardized, because it is a friggin domain-specific =
language (DSL). That's what is so great about it!!!!
- DM
On Jan 31, 2010, at 04:19 AM, Marcel Hendrix wrote:
> David McClain <dbm_at_refined-audiometrics.com> writes Re: generating =
self-contained dlls: sf or swiftx?
>=20
>> You will need to be able to generate a 1024-bit prime number of the =
form
>> P =3D 2*N+1, ...
>=20
> Would you approve of:=20
>=20
> 1. generating a 511 bit random number N (bit 511 =3D 1)
> 2. calculate 2*N+1
> 3. test with Miller-Rabin for p times.
>=20
> How sure do you need to be that it is really a prime number?
> How fast should it be?
>=20
> -marcel
>=20
>=20
>=20
>=20
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and
> bug reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>=20
>=20
Dr. David McClain
dbm_at_refined-audiometrics.com
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Sun Jan 31 2010 - 03:30:00 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.