GithubHelp home page GithubHelp logo

ed25519_sign() is significantly different from current libsodium/SUPERCOP ref10 implementations (and generates incompatible output) about ed25519 HOT 5 CLOSED

orlp avatar orlp commented on June 10, 2024
ed25519_sign() is significantly different from current libsodium/SUPERCOP ref10 implementations (and generates incompatible output)

from ed25519.

Comments (5)

orlp avatar orlp commented on June 10, 2024 3

Sorry for the late response. I finally got around to checking this. ed25519_sign is not significantly different from SUPERCOP's ref10, I simply have a different representation of the private key.

ref10 stores the private key by storing the seed (32 bytes) and public key (32 bytes) as the 'private key'.

I instead straight up store the hashed seed (64 bytes) as the private key to not have to re-hash the seed on every sign operation.

So if you simply use the 64 bytes from the ref10 'private key' as the private key in this library you will end up with incorrect results.

If you wish to convert a ref10 private key to a private key for this library you can use:

void ref10_to_lib(unsigned char *private_key, const unsigned char *ref10_private_key) {
    sha512(ref10_private_key, 32, private_key);
    private_key[0] &= 248;
    private_key[31] &= 63;
    private_key[31] |= 64;
}

from ed25519.

dmjones avatar dmjones commented on June 10, 2024 3

@orlp Is it worth putting some info about this prominently on the main README.md? This tripped me up for quite a while, until I dug into closed issues. I imagine a lot of people will expect this to play nicely with other implementations.

(Note: I completely understand why you do what you do, but it may be missed by many).

from ed25519.

19h avatar 19h commented on June 10, 2024

@rdeker Please share any ideas and work. That will help everyone involved :-)

from ed25519.

rdeker avatar rdeker commented on June 10, 2024

I've forked this project and have one with a couple of fixes available at https://github.com/rdeker/ed25519 . To date I haven't heard anything in response to my pull request.

from ed25519.

orlp avatar orlp commented on June 10, 2024

See also this previous question about this exact topic: #1 (comment)

from ed25519.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.