Skip to content

document how to replace ExtendedGroupElement #9

@kevinburke

Description

@kevinburke

I have the following code that uses a fork of curve25519/internal/edwards25519:

func TestUnmarshalMarshal(t *testing.T) {
	pub, _, _ := Keypair(rand.Reader)

	var A edwards25519.ExtendedGroupElement
	var pubBytes [32]byte
	copy(pubBytes[:], pub)
	if !A.FromBytes(&pubBytes) {
		t.Fatalf("ExtendedGroupElement.FromBytes failed")
	}

	var pub2 [32]byte
	A.ToBytes(&pub2)

	if pubBytes != pub2 {
		t.Errorf("FromBytes(%v)->ToBytes does not round-trip, got %x\n", pubBytes, pub2)
	}
}

I looked for matching code in this library and I wasn't quite sure what the replacement for ExtendedGroupElement, FromBytes or ToBytes should be. (Unfortunately I don't understand the crypto primitives well enough to guess at what should be the case or suggest a solution.)

I would love to be able to rip out the internal/edwards25519 fork if I can help it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions