Skip to content

Commit

Permalink
Root Entropy in CtrDrbg
Browse files Browse the repository at this point in the history
  • Loading branch information
malmaud committed Sep 22, 2015
1 parent 3678e93 commit f5e3099
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ctr_drbg.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type CtrDrbg <: AbstractRNG
data::Ptr{Void}
entropy::Nullable{Entropy}

function CtrDrbg()
ctx = new()
Expand All @@ -25,6 +26,7 @@ function f_rng(c_ctx, c_buf, sz)
end

function seed!(rng::CtrDrbg, entropy, pdata)
rng.entropy = Nullable(entropy)
entropy_func = cglobal((:mbedtls_entropy_func, MBED_CRYPTO))
@err_check ccall((:mbedtls_ctr_drbg_seed, MBED_CRYPTO), Cint,
(Ptr{Void}, Ptr{Void}, Ptr{Void}, Ptr{Void}, Csize_t),
Expand Down

2 comments on commit f5e3099

@quinnj
Copy link
Member

@quinnj quinnj commented on f5e3099 Sep 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can haz entropy now?

@malmaud
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all you could ever want

Please sign in to comment.