Thread: Elliptic Curve Implementation using NTL library in C++ [Problem]

  1. #1
    Registered User
    Join Date
    Jan 2011
    Location
    Calcutta, India, India
    Posts
    18

    Post Elliptic Curve Implementation using NTL library in C++ [Problem]

    Ok.. Guys.. Let me be very clear about this.
    This is in no way related to any shady business like keygenning any commercial software.


    I love working on writing softwares & cryptography.
    I've used NTL library to write my own ECC functions & tested them using certicoms example.

    How ever when I wrote a ECDSA_Sign()[Elliptic Curve Digital Signature algorithm]
    using my procs, NTL started behaving irratic.

    I would like to get some assistance on this.

    Here is the enitre project download link :
    http://www.multiupload.com/718AD4OY1J


    br
    KKR
    Last edited by Salem; 02-06-2011 at 01:54 AM. Reason: fix url tag

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Ewww - ECC.rar (10.2 MB)
    1. It's 10MB
    2. It's RAR

    1. Strip out all executables, object files, symbol tables, crash dumps, project files and any other stuff which can be recreated by doing a 'make' or 'rebuild all'
    2. Not everyone has rar

    You should try and generate a small complete example which demonstrates your specific problem. Ie, something where you can ask a specific question and we can look at a small amount of code in hopefully a small amount of time (which is given freely I might add).

    A side benefit of attempting to produce a small complete example is that you might actually figure out what you did wrong to begin with the first time around. In which case, you already have your answer (and a handy technique to help you in future).

    You're looking at days of solid commitment from someone to look at that monster!
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Location
    Calcutta, India, India
    Posts
    18

    Wink

    hehe.. sry.. I'll also attach the .cpp file.
    But the thing only has the code required for the thing to work properly.

    But you will need the ntl static library to be able to compile it.

    Thats why I've attached the enitre thing.

    But here is the .cpp file.

    Attachment 10344

    Hope this helps. & as far as the problem goes, while running the ECDSA code, the NTL lib does stupid things like - after a mod operation the value is negative.
    This negative val remains negative even after
    if (val < 0)
    {
    val = prime + val;
    }

    This results in a malfunctioning of the InvMod() function as it doesn't take a negative number as the 1st param.

    But surprisingly, the code works with the small example params which are in certicom website.

    This is what confused the hell out of me

    br
    KKR

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Property Set Library (PSL) - Announcement
    By vultur_gryphus in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-29-2008, 06:04 AM
  2. Ntl Library
    By svaidya in forum C++ Programming
    Replies: 1
    Last Post: 01-28-2008, 12:49 AM
  3. Library Implementation of nullptr
    By laserlight in forum C++ Programming
    Replies: 1
    Last Post: 12-27-2007, 04:14 PM
  4. Writing your own C++ Standard Library implementation...
    By SlyMaelstrom in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 10-02-2006, 07:54 PM
  5. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM