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()}")
}Output
64
pub(api) static fn sign(secretKey: &secret<bytes>, message: bytes) -> bytes | CryptoErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
secretKey | &secret<bytes> |
message | bytes |
Returns
bytes
Errors
CryptoError@error- `CryptoError` when the private key is not 32 bytes.
Effects
none declared (pure unless the body says otherwise)
Defined in: std/crypto/crypto.oxl:637