mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
Remove the read_entire_file from the crypto utils and now use the one within core:os
This commit is contained in:
@@ -18,7 +18,6 @@ import "core:io"
|
||||
import "../botan"
|
||||
import "../_ctx"
|
||||
import "../_sha3"
|
||||
import "../util"
|
||||
|
||||
/*
|
||||
Context initialization and switching between the Odin implementation and the bindings
|
||||
@@ -258,7 +257,7 @@ hash_file_odin_28 :: #force_inline proc(ctx: ^_ctx.Hash_Context, hd: os.Handle,
|
||||
if !load_at_once {
|
||||
return hash_stream_odin_28(ctx, os.stream_from_handle(hd))
|
||||
} else {
|
||||
if buf, ok := util.read_entire_file(hd); ok {
|
||||
if buf, ok := os.read_entire_file(hd); ok {
|
||||
return hash_bytes_odin_28(ctx, buf[:]), ok
|
||||
}
|
||||
}
|
||||
@@ -299,7 +298,7 @@ hash_file_odin_32 :: #force_inline proc(ctx: ^_ctx.Hash_Context, hd: os.Handle,
|
||||
if !load_at_once {
|
||||
return hash_stream_odin_32(ctx, os.stream_from_handle(hd))
|
||||
} else {
|
||||
if buf, ok := util.read_entire_file(hd); ok {
|
||||
if buf, ok := os.read_entire_file(hd); ok {
|
||||
return hash_bytes_odin_32(ctx, buf[:]), ok
|
||||
}
|
||||
}
|
||||
@@ -340,7 +339,7 @@ hash_file_odin_48 :: #force_inline proc(ctx: ^_ctx.Hash_Context, hd: os.Handle,
|
||||
if !load_at_once {
|
||||
return hash_stream_odin_48(ctx, os.stream_from_handle(hd))
|
||||
} else {
|
||||
if buf, ok := util.read_entire_file(hd); ok {
|
||||
if buf, ok := os.read_entire_file(hd); ok {
|
||||
return hash_bytes_odin_48(ctx, buf[:]), ok
|
||||
}
|
||||
}
|
||||
@@ -381,7 +380,7 @@ hash_file_odin_64 :: #force_inline proc(ctx: ^_ctx.Hash_Context, hd: os.Handle,
|
||||
if !load_at_once {
|
||||
return hash_stream_odin_64(ctx, os.stream_from_handle(hd))
|
||||
} else {
|
||||
if buf, ok := util.read_entire_file(hd); ok {
|
||||
if buf, ok := os.read_entire_file(hd); ok {
|
||||
return hash_bytes_odin_64(ctx, buf[:]), ok
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user