---
title: "signature(for:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/curve25519/signing/privatekey/signature(for:)"
---

# signature(for:)

Generates an EdDSA signature over Curve25519.

## Declaration

```swift
func signature<D>(for data: D) throws -> Data where D : DataProtocol
```

## Parameters

- `data`: The data to sign.

## Return Value

Return Value The signature for the data. Although not required by RFC 8032, which describes the Edwards-Curve Digital Signature Algorithm (EdDSA), the CryptoKit implementation of the algorithm employs randomization to generate a different signature on every call, even for the same data and key, to guard against side-channel attacks.
