# \{aegis,aes_gcm\}: fix overflow with large inputs on 32-bit systems \(\#19270\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 153ba46a5b20f178d48ef2f09e0e638a3749af0e

Requested commit: 153ba46a5b20f178d48ef2f09e0e638a3749af0e

Commit: 153ba46a5b20f178d48ef2f09e0e638a3749af0e

Tree: e22ac3519e43eeb4e82511f572a1bcdb5a454576

Author: Frank Denis

Committer: GitHub

## Message

```
{aegis,aes_gcm}: fix overflow with large inputs on 32-bit systems (#19270)

These systems write the number of *bits* of their inputs as a u64.

However if `@sizeOf(usize) == 4`, an input message or associated data
whose size is > 512 MiB could overflow.

On 64-bit systems, it is safe to assume that no machine has more than
2 EiB of memory.
```

## Parents

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

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