-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(shortint): new parameters #1886
Changes from all commits
3432b94
d89c93c
4a23eb4
3f420f4
387c907
531d71a
1cd88c8
8676a65
f1eb675
a2a54a4
71fb6c5
3667154
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use criterion::Criterion; | ||
use tfhe::prelude::*; | ||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
use tfhe::shortint::prelude::*; | ||
use tfhe::{generate_keys, ConfigBuilder, FheUint64}; | ||
use tfhe_trivium::{TransCiphering, TriviumStreamShortint}; | ||
|
@@ -12,12 +12,12 @@ pub fn trivium_shortint_warmup(c: &mut Criterion) { | |
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into(); | ||
|
||
let (client_key, server_key): (ClientKey, ServerKey) = | ||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same story here |
||
|
||
let ksk = KeySwitchingKey::new( | ||
(&client_key, Some(&server_key)), | ||
(&underlying_ck, &underlying_sk), | ||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
V0_11_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
); | ||
|
||
let key_string = "0053A6F94C9FF24598EB".to_string(); | ||
|
@@ -63,12 +63,12 @@ pub fn trivium_shortint_gen(c: &mut Criterion) { | |
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into(); | ||
|
||
let (client_key, server_key): (ClientKey, ServerKey) = | ||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
|
||
let ksk = KeySwitchingKey::new( | ||
(&client_key, Some(&server_key)), | ||
(&underlying_ck, &underlying_sk), | ||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
V0_11_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
); | ||
|
||
let key_string = "0053A6F94C9FF24598EB".to_string(); | ||
|
@@ -109,12 +109,12 @@ pub fn trivium_shortint_trans(c: &mut Criterion) { | |
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into(); | ||
|
||
let (client_key, server_key): (ClientKey, ServerKey) = | ||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
|
||
let ksk = KeySwitchingKey::new( | ||
(&client_key, Some(&server_key)), | ||
(&underlying_ck, &underlying_sk), | ||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
V0_11_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
); | ||
|
||
let key_string = "0053A6F94C9FF24598EB".to_string(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use crate::{KreyviumStream, KreyviumStreamByte, KreyviumStreamShortint, TransCiphering}; | ||
use tfhe::prelude::*; | ||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing here most likely as well |
||
use tfhe::{generate_keys, ConfigBuilder, FheBool, FheUint64, FheUint8}; | ||
// Values for these tests come from the github repo renaud1239/Kreyvium, | ||
// commit fd6828f68711276c25f55e605935028f5e843f43 | ||
|
@@ -222,12 +222,12 @@ fn kreyvium_test_shortint_long() { | |
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into(); | ||
|
||
let (client_key, server_key): (ClientKey, ServerKey) = | ||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
|
||
let ksk = KeySwitchingKey::new( | ||
(&client_key, Some(&server_key)), | ||
(&underlying_ck, &underlying_sk), | ||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
V0_11_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
); | ||
|
||
let key_string = "0053A6F94C9FF24598EB000000000000".to_string(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use crate::{TransCiphering, TriviumStream, TriviumStreamByte, TriviumStreamShortint}; | ||
use tfhe::prelude::*; | ||
use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. her as well |
||
use tfhe::{generate_keys, ConfigBuilder, FheBool, FheUint64, FheUint8}; | ||
// Values for these tests come from the github repo cantora/avr-crypto-lib, commit 2a5b018, | ||
// file testvectors/trivium-80.80.test-vectors | ||
|
@@ -358,12 +358,12 @@ fn trivium_test_shortint_long() { | |
let underlying_sk: tfhe::shortint::ServerKey = (*hl_server_key.as_ref()).clone().into(); | ||
|
||
let (client_key, server_key): (ClientKey, ServerKey) = | ||
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64); | ||
|
||
let ksk = KeySwitchingKey::new( | ||
(&client_key, Some(&server_key)), | ||
(&underlying_ck, &underlying_sk), | ||
PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
V0_11_PARAM_KEYSWITCH_1_1_KS_PBS_TO_2_2_KS_PBS, | ||
); | ||
|
||
let key_string = "0053A6F94C9FF24598EB".to_string(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh I think this is not correct as the ConfigBuilder is using the default config, not required to change for the release tomorrow, this is purely at the GitHub repo level, please make a note to look for ConfigBuilder::default() usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing something, but this is just a rename ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the regression was introduced in a previous pr, so yeah we might as well fix it in another pr if that's not blocking for the release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default params for the config is TUniform I believe so the config above in the code (read the full source) should be changed, this parameter set for keyswitch does not match, can be done in a follow up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but the change to tuniform is not from this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep 100%