Skip to content

Commit

Permalink
[float/bootstrapping]: compliant interface to rlwe.Bootstrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro7ech committed Sep 8, 2023
1 parent 98b412d commit 796c35e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
12 changes: 12 additions & 0 deletions circuits/float/bootstrapping/bootstrapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ import (
"github.com/tuneinsight/lattigo/v4/rlwe"
)

func (btp *Bootstrapper) MinimumInputLevel() int {
return 0
}

func (btp *Bootstrapper) OutputLevel() int {
return btp.params.MaxLevel() - btp.Depth()
}

func (btp *Bootstrapper) BootstrapMany(ctIn []*rlwe.Ciphertext) (ctOut []*rlwe.Ciphertext, err error) {
return
}

// Bootstrap re-encrypts a ciphertext to a ciphertext at MaxLevel - k where k is the depth of the bootstrapping circuit.
// If the input ciphertext level is zero, the input scale must be an exact power of two smaller than Q[0]/MessageRatio
// (it can't be equal since Q[0] is not a power of two).
Expand Down
41 changes: 6 additions & 35 deletions circuits/float/test_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,16 @@ import (

var (
testPrec45 = ckks.ParametersLiteral{
LogN: 10,
Q: []uint64{
0x80000000080001,
0x2000000a0001,
0x2000000e0001,
0x2000001d0001,
0x1fffffcf0001,
0x1fffffc20001,
0x200000440001,
},
P: []uint64{
0x80000000130001,
0x7fffffffe90001,
},
LogN: 10,
LogQ: []int{55, 45, 45, 45, 45, 45, 45},
LogP: []int{60},
LogDefaultScale: 45,
}

testPrec90 = ckks.ParametersLiteral{
LogN: 10,
Q: []uint64{
0x80000000080001,
0x80000000440001,
0x1fffffff9001, // 44.99999999882438
0x200000008001, // 45.00000000134366
0x1ffffffe7001, // 44.99999999580125
0x20000001c001, // 45.00000000470269
0x1ffffffe1001, // 44.99999999479353
0x1ffffffce001, // 44.99999999160245
0x200000041001, // 45.00000001091691
0x200000046001, // 45.00000001175667
0x200000053001, // 45.00000001394004
0x1ffffffab001, // 44.99999998572414
0x1ffffffa7001, // 44.99999998505233
0x1ffffffa2001, // 44.99999998421257
},
P: []uint64{
0xffffffffffc0001,
0x10000000006e0001,
},
LogN: 10,
LogQ: []int{55, 55, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45},
LogP: []int{60, 60},
LogDefaultScale: 90,
}

Expand Down

0 comments on commit 796c35e

Please sign in to comment.