Commit Graph

2592 Commits (0e2d858d69ee1595bb58d936f83f0e0248d54d68)

Author SHA1 Message Date
Andrew Kelley 8170a3d574
Merge pull request #6463 from jedisct1/ghash
std/crypto: add GHASH implementation
2020-10-04 02:46:36 -04:00
Andrew Kelley 5fda4fe4c8
Merge pull request #6454 from jedisct1/hkdf
std/crypto: implement the HKDF construction
2020-10-04 02:45:54 -04:00
LemonBoy 538d485782 std: Add pow(a,b) for big ints
Implemented following Knuth's "Evaluation of Powers" chapter in TAOCP,
some extra complexity is needed to make sure there's no aliasing and
avoid allocating too many limbs.

A brief example to illustrate why the last point is important:
consider 10^123, since 10 is well within the limits of a single limb we
can safely say that the result will surely fit in:

⌈log2(10)⌉ bit * 123 = 492 bits = 7 limbs

A naive calculation using only the number of limbs yields:

1 limb * 123 = 123 limbs

The space savings are noticeable.
2020-10-04 02:24:40 -04:00
Andrew Kelley 70f3767903 revert adding std.event.Loop.runDetached
I'd like to discuss this before adding it. I think this is the wrong
direction to go with this API.
2020-10-03 17:13:22 -07:00
Loris Cro 276598346a provide the full buffer length to _NSGetExecutablePath
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-10-03 12:03:22 +02:00
Loris Cro f841ea77e2 make symlink buffer null-terminated
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-10-02 19:33:14 +02:00
Loris Cro a2074c1ec3 fix symlink path not being resolved in darwin
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-10-02 17:06:29 +02:00
Alexandros Naskos 55eb7c16c0
Merge pull request #6494 from IridescentRose/emit-reloc-patch
Emit reloc patch
2020-10-02 17:00:47 +03:00
Alexandros Naskos cd4c1ea790
Merge pull request #6491 from markfirmware/patch-2
Fixes --linker-script unrecognized
2020-10-02 17:00:22 +03:00
Alexandros Naskos 006b780d44
Merge pull request #6484 from LemonBoy/winshit
Some windows fixes
2020-10-02 15:05:44 +03:00
Tadeo Kondrak 183d1d4ba1
Switch TypeInfo.Fn.alignment to comptime_int from u29
All integers in TypeInfo are intentionally comptime_int:
https://github.com/ziglang/zig/issues/1683
2020-10-01 18:01:41 -06:00
Tadeo Kondrak 97ab720d84
stage1: Add alignment to TypeInfo.Fn 2020-10-01 17:59:42 -06:00
Alexandros Naskos 0228887b94
Merge pull request #6428 from tadeokondrak/alignment-typeinfo-struct-union
Add alignment field to TypeInfo.UnionField and TypeInfo.StructField
2020-10-02 02:56:18 +03:00
Nathan 84b6d2a80a Resolved additional formatting issues. 2020-10-01 18:03:34 -04:00
Nathan 5e3ce11b18 Resolve name and format issues. 2020-10-01 17:47:32 -04:00
Alexandros Naskos a4fe438d39
std.fmt.comptimePrint: bufPrint cannot return an error 2020-10-02 00:39:19 +03:00
Tadeo Kondrak 362c87f1aa
Update std.meta.ArgsTuple for alignment in StructField/UnionField 2020-10-01 15:06:24 -06:00
Tadeo Kondrak ec8f0777f2
Update std.meta.Tuple for alignment in StructField/UnionField 2020-10-01 15:06:23 -06:00
Nathan Bourgeois 4566b27373 Patch in emit relocs support 2020-10-01 17:04:04 -04:00
Tadeo Kondrak a12203d2be
Switch TypeInfo alignment fields from u29 to comptime_int 2020-10-01 15:01:28 -06:00
Tadeo Kondrak d81648ce8c
Add alignment field to TypeInfo.UnionField and TypeInfo.StructField
Closes https://github.com/ziglang/zig/issues/6122
2020-10-01 15:01:25 -06:00
Tadeo Kondrak 77df5dae7f
Make builtin.TypeInfo.Pointer.alignment u29 instead of comptime_int 2020-10-01 15:01:24 -06:00
Alexandros Naskos 5acf2a5068
Merge pull request #6419 from tadeokondrak/std.fmt.comptimePrint
std.fmt: add comptimePrint
2020-10-01 23:59:00 +03:00
markfirmware 1296e4a857
Update build.zig 2020-10-01 15:27:08 -04:00
markfirmware 8acfcf4e0d
Update build.zig
Fixes #6477
2020-10-01 13:15:35 -04:00
Alexandros Naskos bf0afaa876
std.event.Loop.runDetached should be pub 2020-10-01 16:50:05 +03:00
Alexandros Naskos beda6f2299
Merge pull request #6455 from kristoff-it/event-loop-go
add runDetached to event loop
2020-10-01 15:57:02 +03:00
LemonBoy 1b2d50737a mingw: Add user32.def for 32bit Windows
Closes #6479
2020-10-01 11:27:59 +02:00
Frank Denis 97fd0974b9 ghash: add pclmul support on x86_64 2020-10-01 02:05:11 +02:00
Frank Denis 8161de7fa4 Implement ghash aggregated reduction
Performance increases from ~400 MiB/s to 450 MiB/s at the expense of
extra code. Thus, aggregation is disabled on ReleaseSmall.

Since the multiplication cost is significant compared to the reduction,
aggregating more than 2 blocks is probably not worth it.
2020-10-01 02:05:07 +02:00
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 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
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 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
Frank Denis d75d6e7f77 Remove unused var, sort std.crypto.* 2020-09-30 01:39:55 +02:00
Frank Denis 6eaba61ef5 std/crypto: implement the HKDF construction 2020-09-30 01:39:55 +02: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