Git Product home page Git Product logo

Comments (2)

bleichen avatar bleichen commented on April 28, 2024

I'm considering to add files with IEEE P1363 encoded signatures. These are fixed length encodings of r and s. There is also the webcrypto format which is similar.

I'm unsure whether raw r and s makes sense. The question is to find the boundaries in this case.
Libraries that allow arbitrary inputs (e.g. stuff written in javascript or python) are difficult to test in this way. For example a few years ago I found a ridiculous implementation in python, where any signatures
were easily forged by setting r=1 and s=0.5
The library would verify the signatures somewhat like this:
First check 0<r<q and 0<s<q, which of course passes.
Then compute the modular inverse of s. Because of lack of checks it would result in s^-1 mod q == 0.
Compute u1 = h(msg) * s^-1 mod q (hence get u1 = 0)
Compute u2 = r * s^-1 mod q (hence get u2=0)
Compute v = g^u1 y^u2 mod p mod q (and get v = 1)
and finally verify v == r.

If the signatures are in a specific encoding then such examples can be tested if the encoding allows
such input (e.g. ASN does) or leave them out if the encoding does not support such things.
Generally the goal is to have test vectors that are close to the input formats that are actually used.

from wycheproof.

thaidn avatar thaidn commented on April 28, 2024

Test vectors with P1363 encoded signatures were added.

Please reopen this ticket if you need more help or want to discuss this further.

from wycheproof.

Related Issues (20)

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.