Commit Graph

10724 Commits (f1ad94437baaae40109f388a7d44d698c10a56d3)

Author SHA1 Message Date
Frank Denis f1ad94437b ghash & poly1305: use pointer to slices for keys and output 2020-10-01 02:04:30 +02:00
Frank Denis 58873ed3f9 std/crypto: add GHASH implementation
GHASH is required to implement AES-GCM.

Optimized implementations for CPUs with instructions for carry-less
multiplication will be added next.
2020-10-01 02:04:30 +02:00
Alexandros Naskos 4eb390b157
Merge pull request #6457 from Snektron/fix-arraylistunmanaged
Fix std.ArrayListUnmanaged + improve test coverage
2020-10-01 00:09:45 +03:00
Andrew Kelley 718a659773 std: skip some tests that stage1 leaks too much memory with
We can restore these when we have self-hosted available.

This is intended to address #6467
2020-09-30 12:37:00 -07:00
Andrew Kelley fe117d9961
Merge pull request #6250 from ziglang/stage2-zig-cc
move `zig cc`, `zig translate-c`, `zig libc`, main(), and linking from stage1 to stage2
2020-09-30 04:28:19 -04:00
Andrew Kelley 3249e5d952 MachO: add the same workaround for no -r LLD flag support
This is the MachO equivalent for the code added to COFF for doing the
file copy when the input and output are both just one object file.
2020-09-30 01:04:30 -07:00
Andrew Kelley 2a893efae1 fix incorrect dylib filename pattern in the previous commit 2020-09-30 00:53:55 -07:00
Andrew Kelley 870af49074 std.zig.binNameAlloc: take into account version for macos dylibs 2020-09-30 00:36:20 -07:00
Ryan Liptak bd449b184a Add deleteDir test with exception for not-empty directory on Windows
Re-adds the test that was added and then reverted in https://github.com/ziglang/zig/pull/6397, but with the test for https://github.com/ziglang/zig/issues/5537 skipped for now since that issue is no longer fixed.
2020-09-30 02:35:17 -04:00
Andrew Kelley 14d6d07af2 fix the cli test expected string to support native path separators 2020-09-30 01:31:08 -04:00
Andrew Kelley 839bdfdc93 link.Coff: skip redundant (and invalid) copy to same path 2020-09-29 21:48:50 -07:00
Andrew Kelley 7bffa6f1fb clean up call to std.fs.rename
Thanks Ryan Liptak!
2020-09-29 21:47:37 -07:00
Andrew Kelley 1572cd4d76 different strategy to fix compiler_rt.zig and c.zig
with respect to std.builtin.link_libc.

The commit 27e008eb29 did not solve the
problem because although it got std.builtin.link_libc to be true for
compiler_rt.zig and c.zig, it had other unintentional side effects which
broke the build for -lc -target foo-linux-musl.

This commit introduces a new flag to Compilation to allow setting this
comptime flag to true without introducing other side effects to
compilation and linking.
2020-09-29 18:32:41 -07:00
Ryan Liptak 254ee89def Windows: Handle ACCESS_DENIED in DeviceIoControl
This was causing the Dir.readLink test to fail for me locally with error.Unexpected NTSTATUS=0xc0000022. Not sure if PRIVILEGE_NOT_HELD is actually possible or not.
2020-09-29 20:54:45 -04:00
Andrew Kelley 402f967ed5 move std.http to the standard library orphanage
I want to take the design of this in a different direction. I think this
abstraction is too high level. I want to start bottom-up.

std-lib-orphanage commit 179ae67d61455758d71037434704fd4a17a635a9
2020-09-29 17:40:37 -07:00
Andrew Kelley af64fd2f42 Merge remote-tracking branch 'origin/master' into stage2-zig-cc
This merges in the revert that fixes the broken Windows build of master
branch.
2020-09-29 17:26:09 -07:00
Andrew Kelley 27e008eb29 fix not passing std.builtin.link_libc to compiler_rt.zig and c.zig
comment reproduced here:

This is so that compiler_rt and libc.zig libraries know whether they
will eventually be linked with libc. They make different decisions
about what to export depending on whether another libc will be linked
in. For example, compiler_rt will not export the __chkstk symbol if it
knows libc will provide it, and likewise c.zig will not export memcpy.
2020-09-29 17:24:21 -07:00
Andrew Kelley f69650a478 update wasm to use ".o.wasm" extension for objects
This is convenient for debugging purposes, as well as simplifying the
caching system since executable basenames will not conflict with their
corresponding object files.
2020-09-29 17:01:05 -07:00
Andrew Kelley d1cea16f5c move std.BloomFilter to the standard library orphanage 2020-09-29 16:39:05 -07:00
Jakub Konka bb636cb3bf Revert "Fix for Windows: std.os.windows.DeleteFile()" 2020-09-29 19:35:44 -04:00
Andrew Kelley 63685190da move std.rb to the standard library orphanage
https://github.com/ziglang/std-lib-orphanage/

This code is not used by anything else in the standard library or by the
compiler or any of its tools and therefore it's a great candidate
to be maintained by a third party.
2020-09-29 16:01:51 -07:00
Andrew Kelley b811a99af9 Merge remote-tracking branch 'origin/master' into stage2-zig-cc 2020-09-29 14:53:48 -07:00
Andrew Kelley 0da7c4b0c8 improve stage2 COFF LLD linking
* change some {} to be {s} to gain type safety
 * fix libraries being libfoo.lib instead of foo.lib for COFF
 * when linking mingw-w64, add the "always link" libs so that we
   generate DLL import .lib files for them as the linker code relies on.
 * COFF LLD linker does not support -r so we do a file copy as an
   alternative to the -r thing that ELF linking does.
   I will file an issue for the corresponding TODO upon merging this
   branch, to look into an optimization that possibly elides this copy
   when the source and destination are both cache directories.
 * add a CLI error message when trying to link multiple objects into one
   and using COFF object format.
2020-09-29 14:48:12 -07:00
Andrew Kelley 56c5b665a1
Merge pull request #6448 from LemonBoy/some-vec-fixes
Some vector fixes
2020-09-29 15:19:09 -04:00
Andrew Kelley a1ae3f92c1
Merge pull request #6442 from jedisct1/aegis
std/crypto: add the AEGIS AEADs
2020-09-29 15:18:06 -04:00
Andrew Kelley 65b03092e3
Merge pull request #6450 from jedisct1/gimli-opt
std/crypto: make Gimli 60% faster
2020-09-29 15:16:52 -04:00
Andrew Kelley 7c0ee42385 CI: TERM=dumb to source hut 2020-09-29 12:10:38 -07:00
Andrew Kelley d8fa8b5455 use Allocator.allocSentinel now that the stage1 bug is fixed
Thanks @LemonBoy!
2020-09-29 12:06:35 -07:00
Robin Voetter 4102ba37dd Fix std.ArrayListUnmanaged + improve test coverage 2020-09-29 19:49:13 +02:00
Alexandros Naskos 3b478631fb
Merge pull request #6415 from MasterQ32/args-tuple
Implements std.meta.ArgsTuple.
2020-09-29 20:28:56 +03:00
Frank Denis 8d67f15d36 aegis: add test vectors, and link to the latest version of the spec 2020-09-29 17:10:04 +02:00
Frank Denis bb1c6bc376 Add AEGIS-256 as well 2020-09-29 17:10:04 +02:00
Frank Denis 9f274e1f7d std/crypto: add the AEGIS128L AEAD
Showcase that Zig can be a great option for high performance cryptography.

The AEGIS family of authenticated encryption algorithms was selected for
high-performance applications in the final portfolio of the CAESAR
competition.

They reuse the AES core function, but are substantially faster than the
CCM, GCM and OCB modes while offering a high level of security.

AEGIS algorithms are especially fast on CPUs with built-in AES support, and
the 128L variant fully takes advantage of the pipeline in modern Intel CPUs.

Performance of the Zig implementation is on par with libsodium.
2020-09-29 17:10:04 +02:00
Alexandros Naskos d27a34f05c
Merge branch 'master' into args-tuple 2020-09-29 16:19:44 +03:00
Alexandros Naskos 3342e28784
Merge pull request #6416 from MasterQ32/meta-tuple
Implements std.meta.Tuple(), implements #4607 in userland.
2020-09-29 15:59:27 +03:00
Alexandros Naskos c98d55626d
Merge pull request #6453 from kristoff-it/fix-futures
Fix std.event.Future
2020-09-29 15:56:21 +03:00
Frank Denis 56d820087d gimli: make permute a constant, remove leading underscore 2020-09-29 14:01:08 +02:00
Frank Denis 4194714965 Don't unroll the gimli permutation on release-small 2020-09-29 13:23:04 +02:00
Loris Cro a45a4230bc Fix std.event.Future
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-29 11:18:35 +02:00
Andrew Kelley 3efdd7b2ad don't try to build musl crti.o crtn.o when it's not needed
such as on RISC-V
2020-09-29 01:30:35 -07:00
Frank Denis 613f8fe83f Use mem.copy() instead of manual iterations 2020-09-29 10:23:00 +02:00
Andrew Kelley d3a99c7bd5 add CLI options for darwin frameworks and -ffunction-sections
and add missing usage help text
2020-09-29 00:50:20 -07:00
Andrew Kelley cfbcb41160 stage2: add CLI option for -fstack-report 2020-09-29 00:34:53 -07:00
Andrew Kelley 750b00c642 Merge remote-tracking branch 'origin/master' into stage2-zig-cc 2020-09-29 00:27:48 -07:00
Andrew Kelley fa6d150441 stage2: MachO LLD Linking 2020-09-29 00:26:18 -07:00
Andrew Kelley 41f6627521 stage2: infer --strip on wasm builds 2020-09-29 00:25:48 -07:00
Andrew Kelley af6c3a3934 mingw: better -D arg for processing def.in files
Thanks @LemonBoy
2020-09-29 00:24:54 -07:00
Andrew Kelley 9d0da1612e langref: use general purpose allocator in the wasi example 2020-09-29 00:24:17 -07:00
Andrew Kelley ed06a78f35 stage2: WASM LLD linking 2020-09-28 23:20:14 -07:00
Andrew Kelley 73167e80f8 stage2: fix Cache not calling ftruncate in writeManifest
this led to a corrupt cache when the number of files got smaller. it is
now fixed.
2020-09-28 22:40:50 -07:00