tobogganSe connecter

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.

17 lignes · 489 octetsBrut · Historique
1// An Ed25519 seed is 32 bytes: another length stops the actor, on both
2// backends (ADR 0067).
3
4import std/bytes
5import std/crypto
6import std/io
7import std/string
8
9pub 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