Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

hpke: fix encapsulation seed in test for xyber #428

Merged
merged 1 commit into from Apr 14, 2023
Merged

Conversation

bwesterb
Copy link
Member

@bwesterb bwesterb commented Apr 14, 2023

Instead of providing an ephemeral keypair for test vectors,
for which Kyber does not have an analogue, we provide the encapsulation seed.

@bwesterb bwesterb changed the title hpke: fix encapsulation seed for xyber hpke: fix encapsulation seed in test for xyber Apr 14, 2023
@bwesterb bwesterb force-pushed the bas/fix-xyber-encseed branch 3 times, most recently from 5e6485a to 9995e98 Compare April 14, 2023 12:23
hpke/vectors_test.go Show resolved Hide resolved
hpke/vectors_test.go Show resolved Hide resolved
hpke/vectors_test.go Show resolved Hide resolved
hpke/vectors_test.go Outdated Show resolved Hide resolved
Comment on lines +392 to +395
if rnd2.Len() != 0 {
t.Fatal()
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if rnd2.Len() != 0 {
t.Fatal()
}

It doesn't seem like this is needed since we always create it as 64 bytes up above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is defensive programming, to make sure we don't have a mismatch between the amount of randomness in the buffer and the actual amount consumed. It's not necessary now, but it might be once we check the upstream test vectors and copy-paste this code.

Instead of providing an ephemeral keypair for test vectors,
for which Kyber does not have an analogue, we provide the encapsulation seed.
@bwesterb bwesterb merged commit aef7250 into main Apr 14, 2023
10 checks passed
@bwesterb bwesterb deleted the bas/fix-xyber-encseed branch April 14, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants