Commit Graph

4085 Commits

Author SHA1 Message Date
gingerBill
0888c69b57 Remove unneeded typeid_of 2023-11-23 17:16:21 +00:00
Jeroen van Rijn
f6308ab5b9 Merge pull request #2899 from jakubtomsu/more-sys-windows
More `core:sys/windows` bindings (primarily MiniDump and SHGetKnownFolderPath)
2023-11-23 16:26:29 +01:00
gingerBill
3baf8d92c3 Add assert to disallow -no-crt when importing core:c/libc 2023-11-23 01:20:19 +00:00
Michael Kutowski
3d90e580c5 check to see if s.builder is nil 2023-11-23 00:04:06 +01:00
Michael Kutowski
f635d3d8af forgot to use the old package name 2023-11-23 00:02:48 +01:00
Michael Kutowski
29f1b79d70 Add setup_once and clear_all, tidy up old code and add a few comments 2023-11-22 23:56:58 +01:00
gingerBill
955be66f1a Merge pull request #2894 from jakubtomsu/union-tag-intrinsics
New built-in procedures for unions
2023-11-22 16:26:15 +00:00
jakubtomsu
a0e6ae6f33 return uintptr from type_union_tag_offset 2023-11-22 17:15:27 +01:00
gingerBill
4af77aeff6 Lower MAP_MIN_LOG2_CAPACITY from 6 to 3 (64->8) 2023-11-22 15:04:41 +00:00
gingerBill
a4c64002c5 Merge pull request #2967 from reavencode/master
Add DwmGetWindowAttribute to core/sys/windows
2023-11-22 12:54:25 +00:00
Jeroen van Rijn
63b6e8216c Fix errant tab in alignment. 2023-11-22 02:57:43 +01:00
reavencode
e2e18324ed Add DwmGetWindowAttribute to core/sys/windows 2023-11-21 22:44:46 +01:00
Michael Kutowski
2af2a035dc Merge branch 'odin-lang:master' into master 2023-11-21 21:05:16 +01:00
skytrias
f97ccca514 added ToUnicode to win32 2023-11-21 21:01:05 +01:00
Jeroen van Rijn
db89c2ccd0 Remap EOF for Windows in stream proc 2023-11-18 18:13:56 +01:00
Jeroen van Rijn
0c97f6aa4e Fix unhandled EOF in streaming io on Windows 2023-11-18 18:01:14 +01:00
Yawning Angel
9cc5cd9d40 core/crypto: Update the documentation (NFC) 2023-11-17 19:54:06 +09: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
4587a55486 core/crypto/sm3: API cleanup
- sm3.Sm3_Context -> sm3.Context
2023-11-17 19:32:09 +09:00
Yawning Angel
7640fb0483 core/crypto/shake: API cleanup
- shake.Shake_Context -> shake.Context
2023-11-17 19:31:51 +09:00
Yawning Angel
b8f9deb3d8 core/crypto/sha3: API cleanup
- sha3.Sha3_Context -> sha3.Context
2023-11-17 19:31:51 +09:00
Yawning Angel
92aad90c6b core/crypto/sha2: API cleanup
- sha2.Sha256_Context -> sha2.Context_256
- sha2.Sha512_Context -> sha2.Context_512
2023-11-17 19:31:51 +09:00
Yawning Angel
506adfb105 core/crypto/sha1: API cleanup
-sha1.Sha1_Context -> Context
2023-11-17 19:31:51 +09:00
Yawning Angel
e819eebc63 core/crypto/md5: API cleanup
- md5.Md5_Context -> md5.Context
2023-11-17 19:31:51 +09:00
Yawning Angel
841e73fcd5 core/crypto/keccak: API cleanup
- keccak.Keccak_Context -> keccak.Context
2023-11-17 19:31:51 +09:00
Yawning Angel
aa821991b8 core/crypto/blake2: API cleanup and bug fixes
- blake2s.Blake2s_Context -> blake2s.Context
- blake2b.Blake2b_Context -> blake2b.Context
- Fix the BLAKE2s low level API (context type was incorrect)
- Support the configurable output size
2023-11-17 19:31:51 +09:00
Yawning Angel
b71afdc3ee core/crypto/sha2: Refactor update/final
This is largely modeled off the SM3 versions of these routines, since
the relevant parts of the code are the same between SHA-256 and SM3,
and the alterations required to support SHA-512 are relatively simple.

The prior versions of update and the transform would leak memory, and
doing things this way also reduces the context buffer sizes by 1 block.
2023-11-17 19:31:51 +09:00
Yawning Angel
bc139ba6c6 core/crypto/util: Remove, no longer needed 2023-11-17 19:31:51 +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
Yawning Angel
70ba4b5321 core/crypto: Add more assertions to the low level API
Assertions here are "fine" and it matches what the code that has the
checks in init/update/final already does.
2023-11-17 19:31:51 +09:00
Yawning Angel
71da3ef925 core/crypto/sha2: Fix overflow for large amounts of hashed data 2023-11-17 19:31:51 +09:00
Yawning Angel
582bd760b7 core/crypto/shake: Add a TODO comment (NFC) 2023-11-17 19:31:51 +09:00
Yawning Angel
e86bb3a795 core/crypto: Change hash asserts to panics
Assertions can be disabled, but at the point where cryptographic
anything is involved, a single branch has an infinitesimally small
performance impact.

The correct thing to do is to punch the caller in the face if they do
something that is blatantly incorrect, especially in a security critical
setting.
2023-11-17 19:31:51 +09:00
Yawning Angel
e3a836f93c core/crypto/sha2: Fix hash_stream_224 and hash_stream_256 2023-11-17 19:31:51 +09:00
Yawning Angel
31b42a53fc core/crypto/siphash: Fix the low-level API
The `update` and `final` routines were written with the assumption that
update will only be called once, and that the underlying data does not
change between the calls.
2023-11-17 19:31:51 +09:00
Yawning Angel
b71d3c739a core/crypto/sm3: Cleanups
- Use `encoding/endian`
- Use `math/bits`
- Add `@(private)` annotations to internals
2023-11-17 19:31:50 +09:00
Yawning Angel
a162b51588 core/crypto/siphash: Cleanups
- Use `encoding/endian`
- Use `math/bits`
- Add `@(private)` annotations to internals
- Minor optimization
2023-11-17 16:53:29 +09:00
Yawning Angel
7c1119f217 core/crypto/_sha3: Cleanups
- Use `math/bits`
2023-11-17 16:53:29 +09:00
Yawning Angel
b0397581db core/crypto/sha2: Cleanups
- Use `encoding/endian`
- Use `math/bits`
- Add `@(private)` annotations to internals
2023-11-17 16:53:29 +09:00