473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Elliptic Code

Hi

Does anyone have/know of a python implementation of the elliptic curve
factoring algorithm (lenstra) which is both:

simply and cleanly coded
functional

I'm aware of William Stein's code (from elementary number theory book) but I
don't understand his coding style and the algorithm doesn't seem to work
efficiently.

For that matter has anyone come across any useable math/number theory
packages apart from nzmath or aladim?

Thanks

Phil
Jul 18 '05 #1
5 2887
phr
"Philip Smith" <as********@blueyonder.co.uk> writes:
Does anyone have/know of a python implementation of the elliptic curve
factoring algorithm (lenstra) which is both:

simply and cleanly coded
functional
It's not in Python but take a look at Mike Scott's C++ implementation
in MIRACL,

http://indigo.ie/~mscott/

It's the simplest and most direct implementation I know of, just the
bare essentials. It could probably be translated into Python pretty
straightforwardly.
I'm aware of William Stein's code (from elementary number theory
book) but I don't understand his coding style and the algorithm
doesn't seem to work efficiently.


A high performance implementation means complicated code, e.g. Peter
Montgomery has done a few of those. If it's for instructional
purposes I think the MIRACL version is far more understandable even if
it's slower.

If you mean you don't understand the algorithm, try Neal Koblitz's
book "A Course in Number Theory and Cryptography". It has no code but
it explains the algorithm in a pretty accessible way.
Jul 18 '05 #2
thanks for the suggestion

I understand the algorithm quite well but how to code the multiplication
stage most efficiently in python eludes me.

William Stein's code is obviously not high performance because in the region
where ecm should do well (30-40 dec digits) my python implementation of the
rho algorithm blows it away. In terms of factoring implementations
generally (in python) I think nzmath's mpqs is brilliant - and it has such a
small footprint I can run it in 10 threads at once.

anyway - I'll have a look at MIRACL (I have the library but have never used
it yet.

Phil

<ph*@localhost.localdomain> wrote in message
news:m3************@localhost.localdomain...
"Philip Smith" <as********@blueyonder.co.uk> writes:
Does anyone have/know of a python implementation of the elliptic curve
factoring algorithm (lenstra) which is both:

simply and cleanly coded
functional


It's not in Python but take a look at Mike Scott's C++ implementation
in MIRACL,

http://indigo.ie/~mscott/

It's the simplest and most direct implementation I know of, just the
bare essentials. It could probably be translated into Python pretty
straightforwardly.
I'm aware of William Stein's code (from elementary number theory
book) but I don't understand his coding style and the algorithm
doesn't seem to work efficiently.


A high performance implementation means complicated code, e.g. Peter
Montgomery has done a few of those. If it's for instructional
purposes I think the MIRACL version is far more understandable even if
it's slower.

If you mean you don't understand the algorithm, try Neal Koblitz's
book "A Course in Number Theory and Cryptography". It has no code but
it explains the algorithm in a pretty accessible way.

Jul 18 '05 #3
Philip Smith <as********@blueyonder.co.uk> wrote:
I understand the algorithm quite well but how to code the multiplication
stage most efficiently in python eludes me.


You might want to look at

http://gmpy.sourceforge.net/

It has very fast multiplication up to any size you like!
--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Jul 18 '05 #4
Nick Craig-Wood <ni**@craig-wood.com> writes:
I understand the algorithm quite well but how to code the multiplication
stage most efficiently in python eludes me.


You might want to look at

http://gmpy.sourceforge.net/

It has very fast multiplication up to any size you like!


I think he's talking about point multiplication on the elliptic curve
group, not integer multiplication.
Jul 18 '05 #5
Quite so - but thanks for your help in any case

"Paul Rubin" <http://ph****@NOSPAM.invalid> wrote in message
news:7x************@ruckus.brouhaha.com...
Nick Craig-Wood <ni**@craig-wood.com> writes:
> I understand the algorithm quite well but how to code the
> multiplication
> stage most efficiently in python eludes me.


You might want to look at

http://gmpy.sourceforge.net/

It has very fast multiplication up to any size you like!


I think he's talking about point multiplication on the elliptic curve
group, not integer multiplication.

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
0
by: flit | last post by:
Hello, I am trying the Python Cryptography Toolkit, but I didnt succeed, maybe I am not used to technical programming docs. WHat I succeed, using the the AES example to encrypt and decrypt....
5
by: Mike Tammerman | last post by:
Hi, I need an elliptic curve library that can be used by python. I googled but couldn't find a one. I'll appreciate, if you could show me. Mike
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.