Commit Graph

271 Commits

Author SHA1 Message Date
Andreas T Jonsson
101abb3004 Simple CI setup for NetBSD 2024-04-25 12:46:55 +02:00
Jeroen van Rijn
2ba2bc1fec Merge pull request #3288 from Yawning/feature/even-moar-crypto
core/crypto: Even more improvments
2024-04-10 14:19:25 +02:00
Laytan Laats
af6d2480fa add bit_field parsing to core:odin/parser
Also adds it to the core type thingy like it is in the compiler.
2024-04-10 01:01:32 +02:00
Yawning Angel
fa1d681e65 tests/core/crypto: Start adding comprehensive curve25519 tests 2024-04-09 14:37:59 +09:00
Yawning Angel
b155fdf8c9 core/crypto: Add has_rand_bytes
This allows runtime detection as to if `rand_bytes` is supported or not,
and lets us enable the test-case on all of the supported targets.
2024-04-09 10:23:58 +09:00
Laytan Laats
133b45d843 fix amd64 sysv abi to pass asan everywhere
I verified the PR by running the entire test suite of Odin itself with
`-sanitize:address` and also the ols test suite (which caused unique problems
before).

A test has also been added with some problematic code, Windows seems to
have problems with asan in CI or in general so it is not ran there.

The LB_ABI_COMPUTE_RETURN_TYPES block has been removed entirely because
it was unused, I got pretty confused why it didn't effect anything at
first.

Fixes #3211
2024-04-04 23:45:23 +02:00
Laytan Laats
31407d9b1b fix 128 bit int alignment on arm64
Fixes #2403
2024-04-04 18:39:41 +02:00
gingerBill
e42b16b106 Merge pull request #3366 from laytan/fix-vet-scope-bug
fix vet scope bug skipping some scopes
2024-04-03 11:40:01 +01:00
Laytan Laats
3a0df80066 correct newly found vets 2024-04-03 00:52:58 +02:00
Jeroen van Rijn
b3580fa63a Make it a HMAC. 2024-04-01 18:20:14 +02:00
Jeroen van Rijn
b2f432c223 Add SHA3-512 digests verification to test assets. 2024-04-01 17:18:31 +02:00
gingerBill
5c9da66595 Merge pull request #3294 from laytan/update-glfw-from-3.3.8-to-3.4
glfw: update from 3.3.8 to 3.4
2024-03-21 15:43:25 +00:00
Jeroen van Rijn
ed5fd15f6e Ensmallen Date struct. 2024-03-20 18:13:29 +01:00
Jeroen van Rijn
89ca15014c Ensmallen Time struct. 2024-03-20 18:09:07 +01:00
Jeroen van Rijn
9c144dd24f Change Ordinal from int to i64 2024-03-20 17:56:22 +01:00
Laytan Laats
65e68f11f8 glfw: update from 3.3.8 to 3.4 2024-03-18 23:54:26 +01:00
Jeroen van Rijn
07ef969546 Fix test label. 2024-03-18 17:05:40 +01:00
Jeroen van Rijn
72c15d7699 Add WiP datetime package and tests.
A new package `core:time/datetime` has been added which can represent moments much further in the past and future than `core:time`.
It is based on *the* reference work on the subject, Calendrical Calculations Ultimate Edition, Reingold & Dershowitz.

More procedures will be added to it in the future, to for example calculate the 3rd Thursday in March to figure out holidays.
The package has been tested for more than a year and can handle dates 25 quadrillion years into the past and future with 64-bit day ordinals, or 5 million with 32-bit ones.

This also fixes a longstanding bug where converting between YYYY-MM:DD hh:mm:ss and `time.Time` and back could result in a mismatch.

RFC 3339 timestamps can now also be parsed using the `core:time` package.
2024-03-18 16:47:16 +01:00
Yawning Angel
c044e295ce vendor/botan: Remove
This is infrequently maintained, and has been a strict subset of what is
available in `core:crypto` for a while.  Instead of improving the
bindings, it is better to spend resources improving `core:crypto`.
2024-03-04 18:20:56 +09:00
Yawning Angel
87ab3f5dc8 tests/core/crypto: Use the tests/common boilerplate 2024-03-04 18:20:56 +09:00
Yawning Angel
b818ebc02f core/crypto/kmac: Initial import 2024-03-04 17:50:45 +09:00
Yawning Angel
c04a53e453 core/crypto/tuplehash: Initial import 2024-03-04 17:50:43 +09:00
Yawning Angel
15287a771f core/crypto/shake: Support cSHAKE 2024-03-04 17:50:24 +09:00
Yawning Angel
550e798c1b core/crypto/hkdf: Initial import 2024-03-04 14:51:38 +09:00
Yawning Angel
290168f862 core/crypto/pbkdf2: Initial import 2024-03-04 14:51:38 +09:00
gingerBill
11b7be1640 Merge pull request #3203 from listeriaceae/master
port math.round from Golang
2024-03-01 11:33:43 +00:00
Yawning Angel
874d6ccb60 core/container/avl: Initial import 2024-02-24 14:05:15 +09:00
Yawning Angel
db3279e7da test/core/container: Refactor for multiple container types 2024-02-24 14:05:15 +09:00
Yawning Angel
9251e06143 tests/core: Bring the Makefile more in-sync with build.bat 2024-02-24 14:05:15 +09:00
Laytan Laats
e6bd79c882 Make sure we are listening before starting the client 2024-02-20 23:54:11 +01:00
Laytan Laats
9e417592e3 Add logs to flaky test 2024-02-20 23:45:15 +01:00
Laytan Laats
bdd6a86d73 Remove flaky test
It wasn't testing the right thing in the previous
iteration.
And in this iteration the behaviour is a timeout on Unix, and
nothing on Windows.
2024-02-20 23:15:18 +01:00
Laytan Laats
1ab3ec5731 Improve net tests
Watching the sporadic CI failures it seems to come from these tests a
lot of the time, this PR cleans up and simplifies (while testing the
same things):

1. Lots of tests were using threads without a need for it
2. Tests had hardcoded `time.sleep` calls which is never a good idea
3. An unclear abstraction was implemented without a real need
4. They weren't being ran on non-windows
5. The `client_connects_to_open_but_not_accepting_port` was not doing
   what you wanted to test for, the `tcp_server` proc was returning, and
   then `dial` was called, which meant that the server already closed
   and you got a refusal error. Now it correctly listens without
   accepting, which even results in a different error because the kernel
   buffer would have buffered the send
2024-02-20 23:06:18 +01:00
Juan Ignacio Díaz
7a592cbb31 port math.round from Golang 2024-02-16 13:23:44 -03:00
Yawning Angel
44758f2a60 core/crypto: Stop using context.temp_allocator
The max digest size for the foreseeable future will be 512 bits, and the
max block size is currently 1152 bits (SHA3-224).  If people add more
exotic hash algorithms without bumping the constants when required,
tests will fail.

The stream buffer will currently be 576 bytes, which is "fine" to just
stick on the stack, and is a sensible multiple of the more common block
size of 64 bytes.
2024-02-07 02:33:53 +09:00
Yawning Angel
1cc639bc93 core/crypto/hmac: Initial import 2024-02-07 00:42:01 +09:00
Yawning Angel
2357293e05 core/crypto/hash: Make the low level interface allocator-less
Just (ab)using reflect to victory is probably fine.
2024-02-07 00:37:18 +09:00
Yawning Angel
bc160d2eb7 tests/core/crypto: Reorganize
All of our crypto is modern now unless exiled to the legacy sub-package,
so move the test cases for the currently un-unified algorithms into the
main test driver file, and rename the benchmark driver to reflect
reality.
2024-02-07 00:37:18 +09:00
Yawning Angel
b02b85d242 core/crypto/shake: SHAKE is an XOF, not a hash 2024-02-07 00:37:18 +09:00
Yawning Angel
1d151c4c92 tests/core/crypto: Cleanup/modernize a bit 2024-02-07 00:37:18 +09:00
Yawning Angel
00ab3beed9 core:crypto/hash: Add a generic higher level hash interface
There is a lot of code duplicated in convenience methods in each hash
implementation, and having a generic hash type makes implementing
higher-level constructs such as HMAC significantly easier down the road.
2024-02-07 00:37:18 +09:00
Laytan Laats
606f11ebe8 fix hxa test use after free, skip weird pow test failure 2024-02-02 21:10:11 +01:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
Jeroen van Rijn
7d3dfb1046 Merge pull request #3006 from hwchen/hwchen/last_index_any
fix strings.last_index_any for single char
2024-01-08 15:57:36 +01:00
Jeroen van Rijn
4efef08c94 Update core:encoding to Unicode 15.1 table. 2024-01-02 18:03:32 +01:00
Walther Chen
031b0cc534 fix strings.last_index_any for single char 2023-12-18 11:55:45 -05:00
Laytan Laats
4ae021cd4c add other failing test and fix them 2023-12-18 15:17:27 +01:00
Laytan Laats
af962526df switch tests around 2023-12-18 14:46:37 +01:00
Laytan Laats
6024af172c add failing test for runtime arena edge case 2023-12-18 14:40:49 +01:00
Hector
82088e4a75 Used strings.builder_reset instead of clear for the string builder 2023-11-25 16:26:29 +00:00