Skip to content
8 changes: 4 additions & 4 deletions src/openfhe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ end
function init_bootstrapping!(context::SecureContext{<:OpenFHEBackend},
private_key::PrivateKey)
cc = get_crypto_context(context)
ring_dimension = OpenFHE.GetRingDimension(cc)
num_slots = div(ring_dimension, 2)
OpenFHE.EvalBootstrapKeyGen(cc, private_key.private_key, num_slots)
encoding_parameters = OpenFHE.GetEncodingParams(cc)
slots = OpenFHE.GetBatchSize(encoding_parameters)
OpenFHE.EvalBootstrapKeyGen(cc, private_key.private_key, slots)

nothing
end
Expand Down Expand Up @@ -115,7 +115,7 @@ end
function bootstrap!(secure_vector::SecureVector{<:OpenFHEBackend})
context = secure_vector.context
cc = get_crypto_context(context)
OpenFHE.EvalBootstrap(cc, secure_vector.data)
secure_vector.data = OpenFHE.EvalBootstrap(cc, secure_vector.data)

secure_vector
end
Expand Down
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Holds encrypted data for arithmetic operations. Can be converted to a `PlainVect

See also: [`PlainVector`](@ref), [`decrypt`](@ref)
"""
struct SecureVector{CryptoBackendT <: AbstractCryptoBackend, DataT}
mutable struct SecureVector{CryptoBackendT <: AbstractCryptoBackend, DataT}
data::DataT
length::Int
capacity::Int
Expand Down