Giter Club home page Giter Club logo

Comments (2)

kmackay avatar kmackay commented on July 26, 2024

It looks like your buffer for the compressed point is too small. It should be 33 bytes in this case (uECC_BYTES + 1).

Sent from my iPhone

On Feb 28, 2015, at 5:31 PM, Shannon Holland [email protected] wrote:

I'm working with the uECC_secp256r1 curve and am seeing a case where a public key that is compressed then decompressed no longer seems to be correct. The actual byte array is different and any attempts to verify with it will also fail.

For example, the original public key I'm currently using is:
00: 15 1d af e7 69 47 22 9c
08: 34 c1 6b 1b ff af 1b f5
10: 9a e2 ec 61 17 75 35 90
18: 43 5d 0e 3f 35 56 25 b5
20: 7c 27 f6 52 82 c5 64 a4
28: 28 df c1 8d 7f 8c 80 41
30: 45 33 cf 61 92 92 1d ba
38: 12 e6 b4 79 f2 29 6b 36

This compresses to:
00: 02 15 1d af e7 69 47 22
08: 9c 34 c1 6b 1b ff af 1b
10: f5 9a e2 ec 61 17 75 35
18: 90 43 5d 0e 3f 35 56 25

And then decompresses to:
00: 15 1d af e7 69 47 22 9c
08: 34 c1 6b 1b ff af 1b f5
10: 9a e2 ec 61 17 75 35 90
18: 43 5d 0e 3f 35 56 25 45
20: 95 76 37 3c 5b 38 6a dd
28: f8 e8 6a 83 4e 12 1c bb
30: d5 67 2e d7 61 65 c3 6b
38: 7a ce 9c 2a bc b8 b4 c8

At this point attempts to verify with that key will fail.

Should I be able to compress/decompress keys generated with this curve? Thank you for any help!


Reply to this email directly or view it on GitHub.

from micro-ecc.

totalslacker avatar totalslacker commented on July 26, 2024

Ugh - I’m an idiot!

Thank you!

Shannon

On Feb 28, 2015, at 7:12 PM, Ken MacKay [email protected] wrote:

It looks like your buffer for the compressed point is too small. It should be 33 bytes in this case (uECC_BYTES + 1).

Sent from my iPhone

On Feb 28, 2015, at 5:31 PM, Shannon Holland [email protected] wrote:

I'm working with the uECC_secp256r1 curve and am seeing a case where a public key that is compressed then decompressed no longer seems to be correct. The actual byte array is different and any attempts to verify with it will also fail.

For example, the original public key I'm currently using is:
00: 15 1d af e7 69 47 22 9c
08: 34 c1 6b 1b ff af 1b f5
10: 9a e2 ec 61 17 75 35 90
18: 43 5d 0e 3f 35 56 25 b5
20: 7c 27 f6 52 82 c5 64 a4
28: 28 df c1 8d 7f 8c 80 41
30: 45 33 cf 61 92 92 1d ba
38: 12 e6 b4 79 f2 29 6b 36

This compresses to:
00: 02 15 1d af e7 69 47 22
08: 9c 34 c1 6b 1b ff af 1b
10: f5 9a e2 ec 61 17 75 35
18: 90 43 5d 0e 3f 35 56 25

And then decompresses to:
00: 15 1d af e7 69 47 22 9c
08: 34 c1 6b 1b ff af 1b f5
10: 9a e2 ec 61 17 75 35 90
18: 43 5d 0e 3f 35 56 25 45
20: 95 76 37 3c 5b 38 6a dd
28: f8 e8 6a 83 4e 12 1c bb
30: d5 67 2e d7 61 65 c3 6b
38: 7a ce 9c 2a bc b8 b4 c8

At this point attempts to verify with that key will fail.

Should I be able to compress/decompress keys generated with this curve? Thank you for any help!


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #22 (comment).

from micro-ecc.

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.