0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/crypto
Andrew Kelley a71d00a4d5 std.crypto.25519.field: avoid excessive inlining
This valid zig code produces reasonable LLVM IR, however, on the
wasm32-wasi target, when using the wasmtime runtime, the number of
locals of the `isSquare` function exceeds 50000, causing wasmtime
to refuse to execute the binary.

The `inline` keyword in Zig is intended to be used only where it is
semantically necessary; not as an optimization hint. Otherwise, this may
produce unwanted binary bloat for the -OReleaseSmall use case.

In the future, it is possible that we may end up with both `inline`
keyword, which operates as it does in status quo, and additionally
`callconv(.inline_hint)` which has no semantic impact, but may be
observed by optimization passes.

In this commit, I also cleaned up `isSquare` by eliminating an
unnecessary mutable variable, replacing it with several local constants.

Closes #11947.
History 2022-06-27 19:11:55 -07:00
..
25519 std.crypto.25519.field: avoid excessive inlining 2022-06-27 19:11:55 -07:00
aes std.crypto: cosmetic improvement to AES multiplication algorithm (#11616) 2022-05-25 19:23:49 +02:00
pcurves crypto/pcurves: compute constants for inversion at comptime (#11780) 2022-06-13 08:13:52 +02:00
aegis.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
aes.zig std: break up some long lines 2022-01-28 16:23:47 -07:00
aes_gcm.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
aes_ocb.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
argon2.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
bcrypt.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
benchmark.zig std: fix crypto and hash benchmark 2022-04-24 23:01:06 -04:00
blake2.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
blake3.zig std: update tests to stage2 semantics 2022-06-03 20:21:20 +03:00
chacha20.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
ecdsa.zig std/crypto: add support for ECDSA signatures (#11855) 2022-06-15 08:55:39 +02:00
errors.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
ghash.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
gimli.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
hkdf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
hmac.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
isap.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
md5.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
modes.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
pbkdf2.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
phc_encoding.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
poly1305.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
salsa20.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
scrypt.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
sha1.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
sha2.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
sha3.zig std: update tests to stage2 semantics 2022-06-03 20:21:20 +03:00
siphash.zig Fixes comptime 'error: cannot assign to constant' error in siphash. 2022-05-16 22:31:09 -04:00
test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
tlcsprng.zig stage1, stage2: rename c_void to anyopaque (#10316) 2021-12-19 00:24:45 -05:00
utils.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00