mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-28 17:04:34 +00:00
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.
This commit is contained in:
@@ -10,13 +10,13 @@ Please see the chart below for the options.
|
||||
|:-------------------------------------------------------------------------------------------------------------|:-----------------|
|
||||
| [BLAKE2B](https://datatracker.ietf.org/doc/html/rfc7693) | ✔️ |
|
||||
| [BLAKE2S](https://datatracker.ietf.org/doc/html/rfc7693) | ✔️ |
|
||||
| [Keccak](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [MD5](https://datatracker.ietf.org/doc/html/rfc1321) | ✔️ |
|
||||
| [SHA-1](https://datatracker.ietf.org/doc/html/rfc3174) | ✔️ |
|
||||
| [SHA-2](https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/documents/fips180-2.pdf) | ✔️ |
|
||||
| [SHA-3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [SHAKE](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [SM3](https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02) | ✔️ |
|
||||
| legacy/[Keccak](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| legacy/[MD5](https://datatracker.ietf.org/doc/html/rfc1321) | ✔️ |
|
||||
| legacy/[SHA-1](https://datatracker.ietf.org/doc/html/rfc3174) | ✔️ |
|
||||
|
||||
#### High level API
|
||||
Each hash algorithm contains a procedure group named `hash`, or if the algorithm provides more than one digest size `hash_<size>`\*.
|
||||
|
||||
10
core/crypto/legacy/README.md
Normal file
10
core/crypto/legacy/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# crypto/legacy
|
||||
|
||||
These are algorithms that are shipped solely for the purpose of
|
||||
interoperability with legacy systems. The use of these packages in
|
||||
any other capacity is discouraged, especially those that are known
|
||||
to be broken.
|
||||
|
||||
- keccak - The draft version of the algorithm that became SHA-3
|
||||
- MD5 - Broken (https://eprint.iacr.org/2005/075)
|
||||
- SHA-1 - Broken (https://eprint.iacr.org/2017/190)
|
||||
@@ -14,7 +14,7 @@ package keccak
|
||||
import "core:io"
|
||||
import "core:os"
|
||||
|
||||
import "../_sha3"
|
||||
import "../../_sha3"
|
||||
|
||||
/*
|
||||
High level API
|
||||
@@ -27,10 +27,10 @@ import blake2b "core:crypto/blake2b"
|
||||
import blake2s "core:crypto/blake2s"
|
||||
import chacha20 "core:crypto/chacha20"
|
||||
import chacha20poly1305 "core:crypto/chacha20poly1305"
|
||||
import keccak "core:crypto/keccak"
|
||||
import md5 "core:crypto/md5"
|
||||
import keccak "core:crypto/legacy/keccak"
|
||||
import md5 "core:crypto/legacy/md5"
|
||||
import sha1 "core:crypto/legacy/sha1"
|
||||
import poly1305 "core:crypto/poly1305"
|
||||
import sha1 "core:crypto/sha1"
|
||||
import sha2 "core:crypto/sha2"
|
||||
import sha3 "core:crypto/sha3"
|
||||
import shake "core:crypto/shake"
|
||||
|
||||
@@ -2,9 +2,9 @@ package all
|
||||
|
||||
import botan_bindings "vendor:botan/bindings"
|
||||
import botan_blake2b "vendor:botan/blake2b"
|
||||
import keccak "vendor:botan/keccak"
|
||||
import md5 "vendor:botan/md5"
|
||||
import sha1 "vendor:botan/sha1"
|
||||
import keccak "vendor:botan/legacy/keccak"
|
||||
import md5 "vendor:botan/legacy/md5"
|
||||
import sha1 "vendor:botan/legacy/sha1"
|
||||
import sha2 "vendor:botan/sha2"
|
||||
import sha3 "vendor:botan/sha3"
|
||||
import shake "vendor:botan/shake"
|
||||
|
||||
@@ -16,16 +16,16 @@ import "core:testing"
|
||||
import "core:fmt"
|
||||
import "core:strings"
|
||||
|
||||
import "core:crypto/md5"
|
||||
import "core:crypto/sha1"
|
||||
import "core:crypto/sha2"
|
||||
import "core:crypto/sha3"
|
||||
import "core:crypto/keccak"
|
||||
import "core:crypto/shake"
|
||||
import "core:crypto/blake2b"
|
||||
import "core:crypto/blake2s"
|
||||
import "core:crypto/sm3"
|
||||
import "core:crypto/siphash"
|
||||
import "core:crypto/legacy/keccak"
|
||||
import "core:crypto/legacy/md5"
|
||||
import "core:crypto/legacy/sha1"
|
||||
import "core:os"
|
||||
|
||||
TEST_count := 0
|
||||
|
||||
6
tests/vendor/botan/test_vendor_botan.odin
vendored
6
tests/vendor/botan/test_vendor_botan.odin
vendored
@@ -17,11 +17,11 @@ import "core:fmt"
|
||||
import "core:os"
|
||||
import "core:strings"
|
||||
|
||||
import "vendor:botan/md5"
|
||||
import "vendor:botan/sha1"
|
||||
import "vendor:botan/legacy/md5"
|
||||
import "vendor:botan/legacy/sha1"
|
||||
import "vendor:botan/sha2"
|
||||
import "vendor:botan/sha3"
|
||||
import "vendor:botan/keccak"
|
||||
import "vendor:botan/legacy/keccak"
|
||||
import "vendor:botan/shake"
|
||||
import "vendor:botan/blake2b"
|
||||
import "vendor:botan/sm3"
|
||||
|
||||
6
vendor/botan/README.md
vendored
6
vendor/botan/README.md
vendored
@@ -9,13 +9,13 @@ Wrappers for hashing algorithms have been added to match the API within the Odin
|
||||
| Algorithm | |
|
||||
|:-------------------------------------------------------------------------------------------------------------|:-----------------|
|
||||
| [BLAKE2B](https://datatracker.ietf.org/doc/html/rfc7693) | ✔️ |
|
||||
| [Keccak](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [MD5](https://datatracker.ietf.org/doc/html/rfc1321) | ✔️ |
|
||||
| [SHA-1](https://datatracker.ietf.org/doc/html/rfc3174) | ✔️ |
|
||||
| [SHA-2](https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/documents/fips180-2.pdf) | ✔️ |
|
||||
| [SHA-3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [SHAKE](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| [SM3](https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02) | ✔️ |
|
||||
| legacy/[Keccak](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) | ✔️ |
|
||||
| legacy/[MD5](https://datatracker.ietf.org/doc/html/rfc1321) | ✔️ |
|
||||
| legacy/[SHA-1](https://datatracker.ietf.org/doc/html/rfc3174) | ✔️ |
|
||||
|
||||
#### High level API
|
||||
Each hash algorithm contains a procedure group named `hash`, or if the algorithm provides more than one digest size `hash_<size>`.
|
||||
|
||||
10
vendor/botan/legacy/README.md
vendored
Normal file
10
vendor/botan/legacy/README.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# crypto/legacy
|
||||
|
||||
These are algorithms that are shipped solely for the purpose of
|
||||
interoperability with legacy systems. The use of these packages in
|
||||
any other capacity is discouraged, especially those that are known
|
||||
to be broken.
|
||||
|
||||
- keccak - The draft version of the algorithm that became SHA-3
|
||||
- MD5 - Broken (https://eprint.iacr.org/2005/075)
|
||||
- SHA-1 - Broken (https://eprint.iacr.org/2017/190)
|
||||
@@ -14,7 +14,7 @@ package vendor_keccak
|
||||
import "core:os"
|
||||
import "core:io"
|
||||
|
||||
import botan "../bindings"
|
||||
import botan "../../bindings"
|
||||
|
||||
/*
|
||||
High level API
|
||||
@@ -14,7 +14,7 @@ package vendor_md5
|
||||
import "core:os"
|
||||
import "core:io"
|
||||
|
||||
import botan "../bindings"
|
||||
import botan "../../bindings"
|
||||
|
||||
/*
|
||||
High level API
|
||||
@@ -14,7 +14,7 @@ package vendor_sha1
|
||||
import "core:os"
|
||||
import "core:io"
|
||||
|
||||
import botan "../bindings"
|
||||
import botan "../../bindings"
|
||||
|
||||
/*
|
||||
High level API
|
||||
Reference in New Issue
Block a user