Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/simple_ckks_bootstrapping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ using OpenFHE
function simple_ckks_bootstrapping(context)
public_key, private_key = generate_keys(context)

init_multiplication(context, private_key)
init_bootstrapping(context, private_key)
init_multiplication!(context, private_key)
init_bootstrapping!(context, private_key)

x = [0.25, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0, 5.0]
encoded_length = length(x)
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_real_numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ using OpenFHE
function simple_real_numbers(context)
public_key, private_key = generate_keys(context)

init_multiplication(context, private_key)
init_rotation(context, private_key, [1, -2])
init_multiplication!(context, private_key)
init_rotation!(context, private_key, [1, -2])


x1 = [0.25, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0, 5.0]
Expand Down
2 changes: 1 addition & 1 deletion src/SecureArithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export SecureContext, SecureVector, PlainVector
export Unencrypted, OpenFHEBackend

# Crypto operations
export generate_keys, init_multiplication, init_rotation, init_bootstrapping
export generate_keys, init_multiplication!, init_rotation!, init_bootstrapping!
export encrypt, decrypt, decrypt!, bootstrap!

include("types.jl")
Expand Down
6 changes: 3 additions & 3 deletions src/openfhe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ function generate_keys(context::SecureContext{<:OpenFHEBackend})
public_key, private_key
end

function init_multiplication(context::SecureContext{<:OpenFHEBackend}, private_key)
function init_multiplication!(context::SecureContext{<:OpenFHEBackend}, private_key)
cc = get_crypto_context(context)
OpenFHE.EvalMultKeyGen(cc, private_key.private_key)

nothing
end

function init_rotation(context::SecureContext{<:OpenFHEBackend}, private_key, shifts)
function init_rotation!(context::SecureContext{<:OpenFHEBackend}, private_key, shifts)
cc = get_crypto_context(context)
OpenFHE.EvalRotateKeyGen(cc, private_key.private_key, shifts)

nothing
end

function init_bootstrapping(context::SecureContext{<:OpenFHEBackend}, private_key)
function init_bootstrapping!(context::SecureContext{<:OpenFHEBackend}, private_key)
cc = get_crypto_context(context)
ring_dimension = OpenFHE.GetRingDimension(cc)
num_slots = div(ring_dimension, 2)
Expand Down
6 changes: 3 additions & 3 deletions src/unencrypted.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function generate_keys(context::SecureContext{<:Unencrypted})
PublicKey(context, nothing), PrivateKey(context, nothing)
end

init_multiplication(context::SecureContext{<:Unencrypted}, private_key) = nothing
init_rotation(context::SecureContext{<:Unencrypted}, private_key, shifts) = nothing
init_bootstrapping(context::SecureContext{<:Unencrypted}, private_key) = nothing
init_multiplication!(context::SecureContext{<:Unencrypted}, private_key) = nothing
init_rotation!(context::SecureContext{<:Unencrypted}, private_key, shifts) = nothing
init_bootstrapping!(context::SecureContext{<:Unencrypted}, private_key) = nothing

function PlainVector(context::SecureContext{<:Unencrypted}, data::Vector{<:Real})
plain_vector = PlainVector(data, context)
Expand Down