ztcl::crypto sign
Signs a message with an Ed25519 seed.
ztcl::crypto sign ed25519 SEED MESSAGE
Description
Gives the Ed25519 signature of MESSAGE, 64 bytes, by the key of the 32-byte SEED. The signature uses no noise, so a seed and a message give the same signature each time. The command makes no key: the caller gives the seed.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| SEED | bytes | required | The secret seed, 32 bytes. |
| MESSAGE | bytes | required | The bytes to sign. |
Returns
64 bytes.
Examples
Each example of this page runs after package require ztcl::crypto.
% set seed [binary decode hex 9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60]
> string range [binary encode hex [ztcl::crypto sign ed25519 $seed {}]] 0 15
e5564300c360ac72
Errors
% ztcl::crypto sign ed25519 abc x
an Ed25519 seed is 32 bytes
-errorcode ZTCL CRYPTO KEY
% ztcl::crypto sign rsa a b
bad algorithm "rsa": must be ed25519
-errorcode ZTCL CRYPTO ALG
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.10
- Compute cost
- One compute unit for each 4,096 bytes of the message, the data, and the key, and 64 more units for a signature command.