mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
core/crypto/aead: Initial import
This commit is contained in:
@@ -26,7 +26,7 @@ Context :: struct {
|
||||
|
||||
// init inititializes a Context for ChaCha20 or XChaCha20 with the provided
|
||||
// key and iv.
|
||||
init :: proc(ctx: ^Context, key, iv: []byte, impl := Implementation.Simd256) {
|
||||
init :: proc(ctx: ^Context, key, iv: []byte, impl := DEFAULT_IMPLEMENTATION) {
|
||||
if len(key) != KEY_SIZE {
|
||||
panic("crypto/chacha20: invalid (X)ChaCha20 key size")
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import "core:crypto/_chacha20/ref"
|
||||
import "core:crypto/_chacha20/simd128"
|
||||
import "core:crypto/_chacha20/simd256"
|
||||
|
||||
// DEFAULT_IMPLEMENTATION is the implementation that will be used by
|
||||
// default if possible.
|
||||
DEFAULT_IMPLEMENTATION :: Implementation.Simd256
|
||||
|
||||
// Implementation is a ChaCha20 implementation. Most callers will not need
|
||||
// to use this as the package will automatically select the most performant
|
||||
// implementation available.
|
||||
|
||||
Reference in New Issue
Block a user