louise
The Louise language: compiler, runtime, std, tooling
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#125 · main · 16 min 13 s
0Étoiles
0Forks
40Issues
| 1 | // An Ed25519 seed is 32 bytes: another length stops the actor, on both |
| 2 | // backends (ADR 0067). |
| 3 | |
| 4 | import std/bytes |
| 5 | import std/crypto |
| 6 | import std/io |
| 7 | import std/string |
| 8 | |
| 9 | pub fn main :: -> () / <io> |
| 10 | { |
| 11 | let seed = bytes.from_string (string.repeat "7" 32) |
| 12 | io.println "{bytes.length (crypto.ed25519_public_key seed)}" |
| 13 | let short = bytes.slice seed 0 31 |
| 14 | io.println "never printed {bytes.length (crypto.ed25519_sign short seed)}" |
| 15 | } |
| 16 | //> 32 |
| 17 | //! panic: crypto: an Ed25519 seed is 32 bytes, not 31 |