Skip to content

hpke: fix encapsulation seed in test for xyber#428

Merged
bwesterb merged 1 commit intomainfrom
bas/fix-xyber-encseed
Apr 14, 2023
Merged

hpke: fix encapsulation seed in test for xyber#428
bwesterb merged 1 commit intomainfrom
bas/fix-xyber-encseed

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 requested a review from chris-wood April 14, 2023 12:13
@bwesterb bwesterb force-pushed the bas/fix-xyber-encseed branch from b1b1fb7 to 12881a6 Compare April 14, 2023 12:14
@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
@bwesterb bwesterb requested review from armfazh and cjpatton April 14, 2023 12:24
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 force-pushed the bas/fix-xyber-encseed branch from 9995e98 to 04b188f Compare April 14, 2023 12:42
@bwesterb bwesterb merged commit aef7250 into main Apr 14, 2023
@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.

2 participants