Skip to content

Conversation

@tarcieri
Copy link
Member

...as impl'd on EncapsulationKey and DecapsulationKey. According to:

https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

  • as_ is for free borrowed -> borrowed conversions
  • to_ is for expensive borrowed -> owned conversions (used here)

Also, to_bytes better pairs with from_bytes.

...as impl'd on `EncapsulationKey` and `DecapsulationKey`. According to:

https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

- `as_` is for free borrowed -> borrowed conversions
- `to_` is for expensive borrowed -> owned conversions (used here)

Also, `to_bytes` better pairs with `from_bytes`.
@tarcieri tarcieri force-pushed the ml-kem/rename-as-bytes-to-bytes branch from f06520b to 8458fbc Compare January 10, 2026 19:13
@tarcieri tarcieri merged commit 22c9306 into master Jan 10, 2026
23 checks passed
@tarcieri tarcieri deleted the ml-kem/rename-as-bytes-to-bytes branch January 10, 2026 19:15
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