OpenCores
no use no use 1/1 no use no use
Exponential
by Unknown on Nov 25, 2005
Not available!
Hi, I would like to ask if anyone implement exponential calculation in
vhdl and how to go about doing the algorithm. Most importantly, how to
test the algorithm if it is working properly. Thanks.

Exponential
by Unknown on Nov 25, 2005
Not available!
For positive integer exponents, and very large numbers, the BasicRSA project implements a square-and-multiply algorithm for modular exponentiation. It uses two copies of a shift-and-add multiplier, one to do modular squares, and one to do modular multiplication of dissimilar numbers. You have to do a square for every bit position in the exponent, and multiply the square by the result of the multiplication (hint, start with 1) every time the exponent bit position is 1. Testing can be a real pain, since you have to calculate all the exponents used in your test set and compare the correct results with whatever your core produces. I don't know a shortcut for that. -- Steven R. McQueen Phone: (951) 809-3232 Email: srmcqueen at mcqueentech.com Web: www.mcqueentech.com On Fri, 2005-11-25 at 17:23 +0100, oceanfrea at hotmail.com wrote:
Hi, I would like to ask if anyone implement exponential calculation in vhdl and how to go about doing the algorithm. Most importantly, how to test the algorithm if it is working properly. Thanks. _______________________________________________ http://www.opencores.org/mailman/listinfo/cores




Exponential
by Unknown on Nov 27, 2005
Not available!
----- Original Message ----- From: Steven R. McQueensrmcqueen at m...> To: Date: Fri Nov 25 19:05:18 CET 2005 Subject: [oc] Exponential
For positive integer exponents, and very large numbers, the
BasicRSA
project implements a square-and-multiply algorithm for modular
exponentiation. It uses two copies of a shift-and-add multiplier,
one to
do modular squares, and one to do modular multiplication of
dissimilar
numbers. You have to do a square for every bit position in the
exponent,
and multiply the square by the result of the multiplication (hint,
start
with 1) every time the exponent bit position is 1.
Testing can be a real pain, since you have to calculate all the
exponents used in your test set and compare the correct results
with
whatever your core produces. I don't know a shortcut for that.
--
Steven R. McQueen
Phone: (951) 809-3232
Email: srmcqueen at mcqueentech.com
Web: www.mcqueentech.com
On Fri, 2005-11-25 at 17:23 +0100, oceanfrea at hotmail.com wrote:
> Hi, I would like to ask if anyone implement exponential

calculation in
> vhdl and how to go about doing the algorithm. Most

importantly, how to
> test the algorithm if it is working properly. Thanks. > _______________________________________________ > http://www.opencores.org/mailman/listinfo/cores


what about negative integer exponents? Can I implement the same

stuff as you had mentioned?


Exponential
by Unknown on Nov 27, 2005
Not available!
On Sun, 2005-11-27 at 16:59 +0100, oceanfrea at hotmail.com wrote:
----- Original Message ----- From: Steven R. McQueensrmcqueen at m...> To: Date: Fri Nov 25 19:05:18 CET 2005 Subject: [oc] Exponential
> For positive integer exponents, and very large numbers, the
> BasicRSA
> project implements a square-and-multiply algorithm for modular
> exponentiation. It uses two copies of a shift-and-add multiplier,
> one to
> do modular squares, and one to do modular multiplication of
> dissimilar
> numbers. You have to do a square for every bit position in the
> exponent,
> and multiply the square by the result of the multiplication (hint,
> start
> with 1) every time the exponent bit position is 1.
> Testing can be a real pain, since you have to calculate all the
> exponents used in your test set and compare the correct results
> with
> whatever your core produces. I don't know a shortcut for that.
> --
> Steven R. McQueen
> Phone: (951) 809-3232
> Email: srmcqueen at mcqueentech.com
> Web: www.mcqueentech.com
> On Fri, 2005-11-25 at 17:23 +0100, oceanfrea at hotmail.com wrote:
> Hi, I would like to ask if anyone implement exponential

> calculation in
> vhdl and how to go about doing the algorithm. Most

> importantly, how to
> test the algorithm if it is working properly. Thanks. > _______________________________________________ > http://www.opencores.org/mailman/listinfo/cores

>
> what about negative integer exponents? Can I implement the same

stuff as you had mentioned?
_______________________________________________


NO! Negative exponents, and real exponents, are floating point
operations requiring techniques from your calculus or differential
equations class. If you didn't keep the book(s), get a copy! You will
probably not use it much, but when you need it, it will be essential.

The RSA algorithm is concerned only with positive integers, and can take
some special case shortcuts.

Steve



Exponential
by thilo on Nov 30, 2005
thilo
Posts: 3
Joined: Nov 19, 2009
Last seen: Apr 30, 2011
Steven R. McQueen wrote:

For positive integer exponents, and very large numbers, the BasicRSA
project implements a square-and-multiply algorithm for modular
exponentiation. It uses two copies of a shift-and-add multiplier, one to
do modular squares, and one to do modular multiplication of dissimilar
numbers. You have to do a square for every bit position in the exponent,
and multiply the square by the result of the multiplication (hint, start
with 1) every time the exponent bit position is 1.

Testing can be a real pain, since you have to calculate all the
exponents used in your test set and compare the correct results with
whatever your core produces. I don't know a shortcut for that.



practical hint:

on unix is a tool called "bc"
This is really cool for long long big big numbers (integer/fixed point only)
:-)




Basic RSA
by mahtab14 on Aug 12, 2014
mahtab14
Posts: 1
Joined: Jul 14, 2013
Last seen: Sep 14, 2014
Hi

I would like to ask is Implementation of RSA Crypto-Processor(BasicRSA ) Based on Montgomery Algorithm??

Thanks
RE: Exponential
by srmcqueen on Aug 12, 2014
srmcqueen
Posts: 3
Joined: Aug 17, 2003
Last seen: Aug 26, 2014
Hi

I would like to ask is Implementation of RSA Crypto-Processor(BasicRSA ) Based on Montgomery Algorithm??

Thanks


I did develop the algorithm independently, but as nearly as I can tell, BasicRSA is, in fact, a brute force implementation of the Montgomery Algorithm. Montgomery seems to have done something tricky involving closed sets over 0-2^^n where 2^^n is greater than the modulus, with some magic at the end to make everything come out right. I, on the other hand, just applied the modulus to every calculation to keep the adders from becoming too big.

I'm not really very good with set theory, so I cannot claim that I understand the Montgomery Algorithm correctly.
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.