Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DH4096_RFC3526 NIKE produces 519 byte keys sometimes #39

Open
david415 opened this issue Jun 24, 2024 · 0 comments
Open

DH4096_RFC3526 NIKE produces 519 byte keys sometimes #39

david415 opened this issue Jun 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@david415
Copy link
Member

david415 commented Jun 24, 2024

Currently this tests fails for our diffiehellman implementation:

func TestDHKeyLengths(t *testing.T) {
	s := Scheme()

	for i := 0; i < 1000; i++ {
		pubkey1, privkey1, err := s.GenerateKeyPair()
		require.NoError(t, err)

		require.Equal(t, s.PublicKeySize(), len(pubkey1.Bytes()))
		require.Equal(t, s.PrivateKeySize(), len(privkey1.Bytes()))
	}
}

which produces test outputs like this:

go test -v
=== RUN   TestDHKeyLengths
    dh_test.go:17: 
        	Error Trace:	/home/human/code/hpqc/nike/diffiehellman/dh_test.go:17
        	Error:      	Not equal: 
        	           	expected: 520
        	           	actual  : 519
        	Test:       	TestDHKeyLengths
--- FAIL: TestDHKeyLengths (4.87s)
@david415 david415 added the bug Something isn't working label Jun 24, 2024
@david415 david415 moved this to In Progress in Katzenpost project Jun 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

1 participant