Move LibC to lib.cr

This commit is contained in:
Didactic Drunk 2021-06-14 12:21:29 -07:00
parent df977f18e8
commit 08c94c66a0
2 changed files with 12 additions and 11 deletions

11
src/crypto-secret/lib.cr Normal file
View File

@ -0,0 +1,11 @@
require "crypto/subtle"
lib LibC
fun explicit_bzero(Void*, LibC::SizeT) : Void
end
struct Slice(T)
def wipe
LibC.explicit_bzero to_unsafe, bytesize
end
end

View File

@ -1,14 +1,4 @@
require "crypto/subtle" require "./lib"
lib LibC
fun explicit_bzero(Void*, LibC::SizeT) : Void
end
struct Slice(T)
def wipe
LibC.explicit_bzero to_unsafe, bytesize
end
end
# Interface to hold sensitive information (often cryptographic keys) # Interface to hold sensitive information (often cryptographic keys)
# #