# Function crypto::sign

> Signs `message` (the canonical bytes `B`) with context `ctx`, hedged: ML-DSA draws 32 fresh bytes from the OS CSPRNG (FIPS 204 Algorithm 2 with the context prefix built here).

`zaun_community_protocol::crypto::sign` · Function

```rust
pub fn sign(sk: &SecretKey, ctx: Context, message: &[u8]) -> Result<Signature, SignError>
```

Signs `message` (the canonical bytes `B`) with context `ctx`, hedged: ML-DSA draws 32 fresh
bytes from the OS CSPRNG (FIPS 204 Algorithm 2 with the context prefix built here).

# Errors
`SignError::Rng` when the CSPRNG fails.

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/crypto/composite/fn.sign.html)
