# std/crypto: use finer-grained error sets in function signatures \(\#8558\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/10f2d6278946485f057f65bbb3c094a6fcde1adf)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 10f2d6278946485f057f65bbb3c094a6fcde1adf

Requested commit: 10f2d6278946485f057f65bbb3c094a6fcde1adf

Commit: 10f2d6278946485f057f65bbb3c094a6fcde1adf

Tree: d7e4f5182e5fd226a705fb3bfbab9d35faa1e1ef

Author: Frank Denis

Committer: GitHub

## Message

```
std/crypto: use finer-grained error sets in function signatures (#8558)

std/crypto: use finer-grained error sets in function signatures

Returning the `crypto.Error` error set for all crypto operations
was very convenient to ensure that errors were used consistently,
and to avoid having multiple error names for the same thing.

The flipside is that callers were forced to always handle all
possible errors, even those that could never be returned by a
function.

This PR makes all functions return union sets of the actual errors
they can return.

The error sets themselves are all limited to a single error.

Larger sets are useful for platform-specific APIs, but we don't have
any of these in `std/crypto`, and I couldn't find any meaningful way
to build larger sets.

```

## Parents

- [1e06a74348d11e4eef456a067dc5065c1e8b1ee9](https://git.cafe/gitcafe/zig/commit/1e06a74348d11e4eef456a067dc5065c1e8b1ee9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/10f2d6278946485f057f65bbb3c094a6fcde1adf?format=markdown)
