209 Commits

Author SHA1 Message Date
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
Hector
b12bfe407d Updated to tabs and used provided test methods. 2023-11-25 16:21:48 +00:00
Hector
1db5e1250f Binary search improvements
Modified the algorithm so that the index is either the location of the
element if found or the index at which to insert the element to maintain
sorted order.

Also added some tests to verify the above claim.
2023-11-25 13:48:48 +00:00
Jeroen van Rijn
4d89249caf Merge pull request #2939 from laytan/allow-larger-thread-poly-data
Allow larger thread poly data
2023-11-24 14:06:24 +01:00
laytan
2e64866838 fix self_cleanup causing join to fail 2023-11-20 21:23:12 +01:00
Yawning Angel
59950bcad6 core/crypto: Exile keccak, md5 and sha1 to legacy
In an perfect world these would just be removed, but the world is
imperfect, and people are forced to interact/interface with things
that are broken.
2023-11-17 19:32:11 +09:00
Yawning Angel
8af6da5de1 core/crypto/whirlpool: Remove, historical/exotic 2023-11-17 19:31:51 +09:00
Yawning Angel
0b86038482 core/crypto/tiger: Remove, historical/exotic 2023-11-17 19:31:51 +09:00
Yawning Angel
8d943f5902 core/crypto/streebog: Remove, exotic 2023-11-17 19:31:51 +09:00
Yawning Angel
3494a6dcd8 core/crypto/ripemd: Remove, historical/exotic 2023-11-17 19:31:51 +09:00
Yawning Angel
235fec23af core/crypto/md4: Remove, badly broken 2023-11-17 19:31:51 +09:00
Yawning Angel
97b066f112 core/crypto/md2: Remove, badly broken 2023-11-17 19:31:51 +09:00
Yawning Angel
a99c0b3e4a core/crypto/jh: Remove, use SHA-3 2023-11-17 19:31:51 +09:00
Yawning Angel
2a6fb3a387 core/crypto/haval: Remove, badly broken 2023-11-17 19:31:51 +09:00
Yawning Angel
65204f13a8 core/crypto/groestl: Remove, use SHA-3 2023-11-17 19:31:51 +09:00
Yawning Angel
8438d66e6b core/crypto/gost: Remove, exotic 2023-11-17 19:31:51 +09:00
Yawning Angel
44c8da7bf2 core/crypto/blake: Remove, use BLAKE2b/BLAKE2s 2023-11-17 19:31:51 +09:00
Yawning Angel
41fdcfeecf core/crypto/sha2: Add SHA-512/256 2023-11-17 19:31:51 +09:00
Laytan Laats
50f86dc14f Fix shadowing 2023-11-15 19:08:05 +01:00
Laytan Laats
9078ddaf5a Allow larger thread poly data
The poly data currently has the restriction of being less than a
pointer's size, but there is much more space in the `Thread.user_args`
array which can be utilized, this commit allows you to pass types that are
larger than pointer length as long as the total size of the poly data is
less than that of the `Thread.user_args`.
2023-11-15 19:08:03 +01:00