method ed25519.sign
The 64-byte signature of message.
Example:
use std.crypto { ed25519 }
use std.ser { bytesOf }
fn main() io, rand {
let kp = ed25519.generate()
print("{ed25519.sign(&kp.secretKey, bytesOf(&"hello"))!.len()}")
}Вывод
64
pub(api) static fn sign(secretKey: &secret<bytes>, message: bytes) -> bytes | CryptoErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
secretKey | &secret<bytes> |
message | bytes |
Возвращает
bytes
Ошибки
CryptoError@error- `CryptoError` when the private key is not 32 bytes.
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/crypto/crypto.oxl:637