# 25519: remove unused const, safeguard against unreduced scalars \(\#8624\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 030fa5e7ebc21339728c79f33bf5d5d22e0a760e

Requested commit: 030fa5e7ebc21339728c79f33bf5d5d22e0a760e

Commit: 030fa5e7ebc21339728c79f33bf5d5d22e0a760e

Tree: a0793e131036a29abc740888cfeea97fa85ce987

Author: Frank Denis

Committer: GitHub

## Message

```
25519: remove unused const, safeguard against unreduced scalars (#8624)

* 25519: remove unused const, safeguard against unreduced scalars

No behavior change, but it makes the existing code better match
the forthcoming code for other curves.

Rename nonAdjacentForm() to slide(), remove an unneeded and
confusing constant, and do a reduction in slide() if 257 bits would
be required.

Note that in all the high-level functions, the top bit is always
cleared, so the reduction is never necessary. But since the low-level
functions are public, the check is a safe thing to have.

* 25519: make identityElement public, deprecate neutralElement

Also fix a few comments by the way.
```

## Parents

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

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