Commit Graph

30 Commits

Author SHA1 Message Date
mlugg
51595d6b75
lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
Jacob Young
fe93332ba2 x86_64: implement enough to pass unicode tests
* implement vector comparison
 * implement reduce for bool vectors
 * fix `@memcpy` bug
 * enable passing std tests
2023-10-23 22:42:18 -04:00
Jacob Young
27fe945a00 Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""
This reverts commit 6f0198cadb.
2023-10-22 15:46:43 -04:00
Andrew Kelley
6f0198cadb Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"
This reverts commit 0c99ba1eab, reversing
changes made to 5f92b070bf.

This caused a CI failure when it landed in master branch due to a
128-bit `@byteSwap` in std.mem.
2023-10-22 12:16:35 -07:00
Jacob Young
2e6e39a700 x86_64: fix bugs and disable erroring tests 2023-10-21 10:55:41 -04:00
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
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-24 16:56:39 -07:00
jcalabro
2892347440 Fix PBKDF2 docstring comment 2023-05-01 22:14:51 +03:00
Andrew Kelley
6261c13731 update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Andrew Kelley
d29871977f remove redundant license headers from zig standard library
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-08-24 12:25:09 -07:00
Veikka Tuominen
fd77f2cfed std: update usage of std.testing 2021-05-08 15:15:30 +03:00
Frank Denis
10f2d62789
std/crypto: use finer-grained error sets in function signatures (#8558)
std/crypto: use finer-grained error sets in function signatures

Returning the `crypto.Error` error set for all crypto operations
was very convenient to ensure that errors were used consistently,
and to avoid having multiple error names for the same thing.

The flipside is that callers were forced to always handle all
possible errors, even those that could never be returned by a
function.

This PR makes all functions return union sets of the actual errors
they can return.

The error sets themselves are all limited to a single error.

Larger sets are useful for platform-specific APIs, but we don't have
any of these in `std/crypto`, and I couldn't find any meaningful way
to build larger sets.
2021-04-20 19:57:27 +02:00
Frank Denis
6d9b3e7b19 pbkdf2: use std.math.divCeil() 2021-03-17 10:11:47 +01:00
Frank Denis
f609c4ddb3 crypto/pbkdf2: use snake_case for variables like everywhere else 2021-03-16 19:08:38 +01:00
Frank Denis
d1b1e542a0 crypto/pbkdf2: simplify the check for the max number of iterations 2021-03-16 18:55:58 +01:00
Frank Denis
b98d7747fa Use a unified error set for std/crypto/*
This ensures that errors are used consistently across all operations.
2021-03-14 20:51:31 +01:00
Frank Denis
6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
Rocknest
c35703825f Add an error set 2020-09-16 01:58:48 +03:00
Rocknest
988fc6f9d1 flip condition 2020-09-14 02:27:09 +03:00
Rocknest
73863cf72b fix build 2020-09-13 23:59:36 +03:00
Rocknest
b6385870d0 Convert asserts to errors, make sure nothing overflows 2020-09-13 22:39:54 +03:00
Rob Napier
85366771ea pbkdf2 offset into dk should be usize, not u64. 2020-09-13 12:36:32 -04:00
Rob Napier
2f9c9662ba Use comptime to expose public method to doc system 2020-09-13 11:17:58 -04:00
Rob Napier
8a1a40276f Extract kdf.zig to provide namespace documentation 2020-09-13 11:08:06 -04:00
Rob Napier
257c5b5348 Explicitly reference std.crypto.kdf in test case 2020-09-13 10:50:46 -04:00
Rob Napier
0f85b85acb Improve doc text 2020-09-13 09:59:36 -04:00
Rob Napier
17156e1775 pbkdf2 "very large dklen test" should just check for crashes 2020-09-12 18:33:53 -04:00
Rob Napier
3f450b7e93 Replace Hash function with Prf. Correct offset bit-width. 2020-09-12 18:17:04 -04:00
Rob Napier
37db93e426 Review comments from pbkdf2.zig
Move block definitions inside while loop.
Use usize for offset. (This still crashes on overflow)
Remove unneeded slice syntax.
Add slow test for Very large dkLen
2020-09-12 15:03:42 -04:00
Rob Napier
c2b02d01d5 Add crypto.kdf.pbkdf2 2020-09-11 17:10:27 -04:00