# Add std.crypto.utils.timingSafeCompare · gitcafe/zig

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

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

Visibility: public

Requested revision: 0747591c3d7469cf3ac5c1a6a80b6058386e337a

Requested commit: 0747591c3d7469cf3ac5c1a6a80b6058386e337a

Commit: 0747591c3d7469cf3ac5c1a6a80b6058386e337a

Tree: 9efa1127126ffca59aa70fad5fa2529628189580

Author: Frank Denis

Committer: Frank Denis

## Message

```
Add std.crypto.utils.timingSafeCompare

A little function to complement the existing crypto.utils.timingSafeEql
function with a way to compare large numbers serialized as arrays.

This is useful to compare nonces and to check that group elements are
in canonical form.

Absence of side channels remains a best effort, reusing the common
pattern we use elsewhere.

```

## Parents

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

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