Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

The Ed25519 key pair creation from the seed is broken #295

@DieMyst

Description

@DieMyst

If we create key pair from seed, sign and verify some random data, it will fail. I checked it by adding a test case in this repo (here https://github.com/libp2p/js-libp2p-crypto/blob/master/test/keys/ed25519.spec.ts).

    const seed = new Uint8Array(32).fill(1);
    const seededkey = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed)
    const data = uint8ArrayFromString('hello world')
    const sig = await seededkey.sign(data)
    const valid = await seededkey.public.verify(data, sig)
    // `valid` is false
    expect(valid).to.eql(true)

example in fork: https://github.com/DieMyst/js-libp2p-crypto/blob/master/test/keys/ed25519.spec.ts#L151

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