core/crypto: Use panic_contextless instead of intrinsics.trap
This commit is contained in:
1 parent
4c28f6d170
commit
e4e76f27f6
13 files changed
+21
-33
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package _chacha20
|
||||
|
||||
import "base:intrinsics"
|
||||
import "core:encoding/endian"
|
||||
import "core:math/bits"
|
||||
import "core:mem"
|
||||
@@ -47,7 +46,7 @@ Context :: struct {
|
||||
// HChaCha call can be suitably accelerated.
|
||||
init :: proc "contextless" (ctx: ^Context, key, iv: []byte, is_xchacha: bool) {
|
||||
if len(key) != KEY_SIZE || len(iv) != IV_SIZE {
|
||||
intrinsics.trap()
|
||||
panic_contextless("chacha20: invalid key or IV size")
|
||||
}
|
||||
|
||||
k, n := key, iv
|
||||
|
||||
@@ -13,5 +13,5 @@ stream_blocks :: proc(ctx: ^_chacha20.Context, dst, src: []byte, nr_blocks: int)
|
||||
}
|
||||
|
||||
hchacha20 :: proc "contextless" (dst, key, iv: []byte) {
|
||||
intrinsics.trap()
|
||||
panic_contextless("crypto/chacha20: simd256 implementation unsupported")
|
||||
}
|
||||
Reference in new issue
Block a user