aboutsummaryrefslogtreecommitdiff
path: root/lib/std/crypto/pcurves/p256.zig
AgeCommit message (Collapse)Author
2025-05-05std: fix compile errors in `std.crypto.ecc` (#23797)HydroH
Implemented `neg()` method for `AffineCoordinates` struct of p256, p384 and secp256k1 curves. Resolves: #20505 (partially)
2023-11-03x86_64: fix std test failuresJacob Young
2023-10-31std.builtin.Endian: make the tags lower caseAndrew Kelley
Let's take this breaking change opportunity to fix the style of this enum.
2023-10-22Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""Jacob Young
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
2023-10-22Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"Andrew Kelley
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
2023-10-21x86_64: fix bugs and disable erroring testsJacob Young
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13crypto.pcurves: don't assume that points with X=0 are at infinity (#16017)Frank Denis
There's also a valid point with X=0 on each curves. Fixes #16015
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-21std: remove names from incorrectly named testsJacob Young
Tests that only reference decls for the purpose of analyzing more tests should be unnamed, otherwise trying to filter for just a referenced test can become impossible depending on the names.
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2022-06-29std.crypto.{p256,p384}: process the top nibble in mulDoubleBasePublic (#11956)Frank Denis
Unlike curve25519 where the scalar size is not large enough to fill the top nibble, this can definitely be the case for p256 and p384.
2022-05-31crypto: add support for the NIST P-384 curve (#11735)Frank Denis
After P-256, here comes P-384, also known as secp384r1. Like P-256, it is required for TLS, and is the current NIST recommendation for key exchange and signatures, for better or for worse. Like P-256, all the finite field arithmetic has been computed and verified to be correct by fiat-crypto.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-05-27p256: update to the last fiat-crypto code & share PC tablesFrank Denis
fiat-crypto now generates proper types, so take advantage of that. Add mixed subtraction and double base multiplication. We will eventually leverage mixed addition/subtraction for fixed base multiplication. The reason we don't right now is that precomputing the tables at comptime would take forever. We don't use combs for the same reason. Stage2 + less function calls in the fiat-crypto generated code will eventually address that. Also make the edwards25519 code consistent with these changes. No functional changes.
2021-05-12std: fix redundant comptime keywordsAndrew Kelley
caught by stage2 astgen
2021-05-12Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux.zig * lib/std/os/windows/bits.zig * src/Module.zig * src/Sema.zig * test/stage2/test.zig Mainly I wanted Jakub's new macOS code for respecting stack size, since we now depend on it for debug builds able to pass one of the test cases for recursive comptime function calls with `@setEvalBranchQuota`. The conflicts were all trivial.
2021-05-09p256: properly handle neutral element & add AffineCoordinates struct (#8718)Frank Denis
Instead of multiple references to an anonymous structure to represent affine coordinates, add an actual `AffineCoordinates` structure. Also properly handle the neutral element during coordinate conversion and fix mixed addition. And comptime the small precomputation table for basepoint multiplication.
2021-05-05std: fix compile errors found by stage2Andrew Kelley
* redundant `comptime` * `try` outside function * `extern enum`
2021-05-01std.crypto: add support for the NIST P-256 curve (#8627)Frank Denis
Uses verified code generated by fiat-crypto for field arithmetic, and complete formulas to avoid side channels. There's still plenty of room for optimizations, especially with a fixed base. But this gives us a framework to easily add other similar curves.