# crypto/25519: add scalar.random\(\), use CompressedScalar type · gitcafe/zig

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

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

Visibility: public

Requested revision: b08d32ceb5aac5b1ba73c84449c6afee630710bb

Requested commit: b08d32ceb5aac5b1ba73c84449c6afee630710bb

Commit: b08d32ceb5aac5b1ba73c84449c6afee630710bb

Tree: f34db20cb2138a60ae57a2aac334cd6252e8d9c8

Author: Frank Denis

Committer: Jakub Konka

## Message

```
crypto/25519: add scalar.random(), use CompressedScalar type

Add the ability to generate a random, canonical curve25519 scalar,
like we do for p256.

Also leverage the existing CompressedScalar type to represent these
scalars.

```

## Parents

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

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