Skip to content

Different behavior between Node and Browser for invalid SEC1 key #166

@cgewecke

Description

@cgewecke

Hi, ethereumjs-util PR 228 is upgrading secp256k1 from ^3.0.1 to ^4.0.0 and seeing a couple tests for invalid SEC1 keys fail in browser (karma) tests, but pass ok in Node 10. The tests worked in both contexts using 3.0.x

For example, one test case takes an invalid SEC1 key:

const key = Buffer.from('023a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d',
      'hex',
    )

and passes it to publicKeyVerify expecting it to fail.

secp256k1.publicKeyVerify(key) // Returns false in Node, true in Chrome/Firefox

Do you have any advice about this? Is it happening because elliptic treats this key as compressed and as such its valid?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy