Re: simple algorithm for finding primes
Richard Heathfield <dontmail@addre ss.co.uk.invali d> wrote in message
news:brbmj6$i2m $1@hercules.bti nternet.com...[color=blue]
> osmium wrote:
>[color=green]
> > Richard Heathfield writes:
> >[color=darkred]
> >>
> >> Actually, it isn't all that difficult to make bignums portable. There
> >> is no particular reason why you shouldn't be able to implement, say,
> >> RSA using code that will work on any conforming hosted implementation
> >> (and, indeed, on freestanding implementations if they have the RAM
> >> for it; if you have a few kilobytes, you can do it).[/color]
> >
> > I am just an innocent bystander here. But you, Richard, seem to be
> > comparing a program that *could* be written with one that *has* been
> > written.[/color]
>
> Well, if he'd written a portable bignum program already, he'd have said[/color]
so,[color=blue]
> wouldn't he?
>[color=green]
> > I notice you always refer to bignum in the future tense. If you
> > are speaking of an actual library it most likely has an actual name and[/color][/color]
a[color=blue][color=green]
> > parent. My guess is that is where the alleged hypocrisy comes in.[/color]
>
> Ah, I see. Well, we already have Miracl and GMP, do we not? And yes, I[/color]
have[color=blue]
> my own bignum library, which works (except for Rabin-Miller, which I hope
> to fix today), but which is still a bit untidy, which is why I haven't
> published it yet. The fastest in the world it ain't (because the emphasis
> is on readability and portability), but it's fast enough that it is
> unlikely to be the bottleneck in typical usages.
>[color=green]
> > If I were to write a reasonably fast bignum library I would sure like to
> > see that well hidden carry bit.[/color]
>
> Perhaps I'm talking through ignorance here, despite having written one
> myself, but why would anyone need to *hide* a carry bit?[/color]
From the Miracl page:
"MIRACL is compact, fast and efficient and its
now easier than ever to get the same near-optimal
performance from any processor. Although
essentially a portable library, inline assembly
and special techniques can be invoked for
blistering speed"
It would seem to me that the designers of Miracl also wanted to see that
carry out bit which the designers of the C language hid. And the inline
assembly destroys the portability. It is not clear to me that a sensible,
fast, binary, arithmetic big numbers library is possible. I say binary to
exclude BCD arithmetic which is a different kettle of fish. I read
"blistering speed" as meaning reasonably fast.
I will let someone else research GMP. My algorithm is first in, first out.
If I were designing C, I would have considered adding the carry out (and
perhaps other things) as a standard signal. But even so, the resulting big
numbers library would still be slower than necessary.
Richard Heathfield <dontmail@addre ss.co.uk.invali d> wrote in message
news:brbmj6$i2m $1@hercules.bti nternet.com...[color=blue]
> osmium wrote:
>[color=green]
> > Richard Heathfield writes:
> >[color=darkred]
> >>
> >> Actually, it isn't all that difficult to make bignums portable. There
> >> is no particular reason why you shouldn't be able to implement, say,
> >> RSA using code that will work on any conforming hosted implementation
> >> (and, indeed, on freestanding implementations if they have the RAM
> >> for it; if you have a few kilobytes, you can do it).[/color]
> >
> > I am just an innocent bystander here. But you, Richard, seem to be
> > comparing a program that *could* be written with one that *has* been
> > written.[/color]
>
> Well, if he'd written a portable bignum program already, he'd have said[/color]
so,[color=blue]
> wouldn't he?
>[color=green]
> > I notice you always refer to bignum in the future tense. If you
> > are speaking of an actual library it most likely has an actual name and[/color][/color]
a[color=blue][color=green]
> > parent. My guess is that is where the alleged hypocrisy comes in.[/color]
>
> Ah, I see. Well, we already have Miracl and GMP, do we not? And yes, I[/color]
have[color=blue]
> my own bignum library, which works (except for Rabin-Miller, which I hope
> to fix today), but which is still a bit untidy, which is why I haven't
> published it yet. The fastest in the world it ain't (because the emphasis
> is on readability and portability), but it's fast enough that it is
> unlikely to be the bottleneck in typical usages.
>[color=green]
> > If I were to write a reasonably fast bignum library I would sure like to
> > see that well hidden carry bit.[/color]
>
> Perhaps I'm talking through ignorance here, despite having written one
> myself, but why would anyone need to *hide* a carry bit?[/color]
From the Miracl page:
"MIRACL is compact, fast and efficient and its
now easier than ever to get the same near-optimal
performance from any processor. Although
essentially a portable library, inline assembly
and special techniques can be invoked for
blistering speed"
It would seem to me that the designers of Miracl also wanted to see that
carry out bit which the designers of the C language hid. And the inline
assembly destroys the portability. It is not clear to me that a sensible,
fast, binary, arithmetic big numbers library is possible. I say binary to
exclude BCD arithmetic which is a different kettle of fish. I read
"blistering speed" as meaning reasonably fast.
I will let someone else research GMP. My algorithm is first in, first out.
If I were designing C, I would have considered adding the carry out (and
perhaps other things) as a standard signal. But even so, the resulting big
numbers library would still be slower than necessary.
Comment