earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
632 stars 20 forks source link

Cinn25519 shortname encoding is incorrect #354

Open sgwilym opened 1 month ago

sgwilym commented 1 month ago

What's the problem you want solved?

The current Cinn25519 encoding appends 0x0 to an encoded shortname only if shortname.length < max_length. This is wrong.

Is there a solution you'd like to recommend?

The encoded shortname should append 0x0 whenever min_length < max_length, regardless of shortname length.