create_lossy_bootstrap_key
Engine.create_lossy_bootstrap_key(secret_key, stage_count=3, size="medium")
- Creates a lossy bootstrap key for lossy bootstrapping. Requires a secret key. The lossy bootstrap key is internally composed of fixed rotation keys for bootstrapping.
- Input
- SecretKey
- stage_count: optional
- Specifies the number of levels used in coefficient to the slot function and the slot to coefficient function of bootstrapping algorithm. The default value is 3, and values from 3 to 5 are supported. The larger the stage count, the faster the bootstrapping, but the lower the level of the final result.
- size: optional
- Specifies the size of the lossy bootstrap key. The larger the lossy bootstrap key, the faster the lossy bootstrap operation.
medium
and large
are supported. The default value is set to medium
.
- Output
from desilofhe import Engine
engine = Engine(for_bootstrap=True)
secret_key = engine.create_secret_key()
lossy_bootstrap_key = engine.create_lossy_bootstrap_key(secret_key)
medium_lossy_bootstrap_key_with_5_stages = engine.create_lossy_bootstrap_key(
secret_key, stage_count=5
)
large_lossy_bootstrap_key = engine.create_lossy_bootstrap_key(
secret_key, size="large"
)
large_lossy_bootstrap_key_with_4_stages = engine.create_lossy_bootstrap_key(
secret_key, count=4, size="large"
)
Key Sizes
stage_count |
3 |
4 |
5 |
medium |
12.3 GB |
9.1 GB |
7.0 GB |
large |
15.2 GB |
12.9 GB |
8.9 GB |
Stage Count
Stage counts of 3, 4, and 5 are supported by default.
For sparse bootstrapping, the following values are supported.
key_size |
slot_count |
1 |
2 |
3 |
4 |
5 |
medium |
1 |
✅ |
|
|
|
|
medium |
2 |
✅ |
|
|
|
|
medium |
3 |
✅ |
|
|
|
|
medium |
4 |
✅ |
✅ |
|
|
|
medium |
5 |
✅ |
✅ |
|
|
|
medium |
6 |
|
✅ |
|
|
|
medium |
7 |
|
✅ |
✅ |
|
|
medium |
8 |
|
✅ |
✅ |
|
|
medium |
9 |
|
✅ |
✅ |
|
|
medium |
10 |
|
✅ |
✅ |
✅ |
|
medium |
11 |
|
|
✅ |
✅ |
|
medium |
12 |
|
|
✅ |
✅ |
|
medium |
13 |
|
|
✅ |
✅ |
✅ |
medium |
14 |
|
|
✅ |
✅ |
✅ |
large |
3 |
✅ |
|
|
|
|
large |
4 |
✅ |
|
|
|
|
large |
5 |
✅ |
|
|
|
|
large |
6 |
|
✅ |
|
|
|
large |
7 |
|
✅ |
|
|
|
large |
8 |
|
✅ |
|
|
|
large |
9 |
|
✅ |
✅ |
|
|
large |
10 |
|
✅ |
✅ |
|
|
large |
11 |
|
|
✅ |
|
|
large |
12 |
|
|
✅ |
✅ |
|
large |
13 |
|
|
✅ |
✅ |
|
large |
14 |
|
|
✅ |
✅ |
|