Skip to content

Conversation

@tarcieri
Copy link
Member

The type [u8; N] maps naturally to SSH's byte[n] type, which has no length prefix because n is known a priori.

In cases where [u8; N] is being used to store an SSH string, such as Ed25519 public keys, it first needs to be converted to [u8] (which maps to string) using as_slice()

The type `[u8; N]` maps naturally to SSH's `byte[n]` type, which has no
length prefix because `n` is known a priori.

In cases where `[u8; N]` is being used to store an SSH `string`, such as
Ed25519 public keys, it first needs to be converted to `[u8]` (which
maps to `string`) using `as_slice()`
@tarcieri tarcieri merged commit 85f0c56 into master Mar 25, 2025
27 checks passed
tsurdevson added a commit to tsurdevson/SSH that referenced this pull request Mar 26, 2025
Followup to RustCrypto#342, which only updated the `encode` method. This aligns
the `encoded_len` method with that change.
tarcieri pushed a commit that referenced this pull request Mar 26, 2025
Followup to #342, which only updated the `encode` method. This aligns
the `encoded_len` method with that change.
@tarcieri tarcieri deleted the ssh-encoding/remove-length-prefix-from-byte-array-encoding branch April 19, 2025 19:55
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