@@ -102,23 +102,19 @@ struct EvalKey {
102
102
void emplacebkfft (const SecretKey& sk)
103
103
{
104
104
if constexpr (std::is_same_v<P, lvl01param>) {
105
- bkfftlvl01 = std::unique_ptr<BootstrappingKeyFFT<lvl01param>>(
106
- new (std::align_val_t (64 )) BootstrappingKeyFFT<lvl01param>());
105
+ bkfftlvl01 = std::make_unique<BootstrappingKeyFFT<lvl01param>>();
107
106
bkfftgen<lvl01param>(*bkfftlvl01, sk);
108
107
}
109
108
else if constexpr (std::is_same_v<P, lvlh1param>) {
110
- bkfftlvlh1 = std::unique_ptr<BootstrappingKeyFFT<lvlh1param>>(
111
- new (std::align_val_t (64 )) BootstrappingKeyFFT<lvlh1param>());
109
+ bkfftlvlh1 = std::make_unique<BootstrappingKeyFFT<lvlh1param>>();
112
110
bkfftgen<lvlh1param>(*bkfftlvlh1, sk);
113
111
}
114
112
else if constexpr (std::is_same_v<P, lvl02param>) {
115
- bkfftlvl02 = std::unique_ptr<BootstrappingKeyFFT<lvl02param>>(
116
- new (std::align_val_t (64 )) BootstrappingKeyFFT<lvl02param>());
113
+ bkfftlvl02 = std::make_unique<BootstrappingKeyFFT<lvl02param>>();
117
114
bkfftgen<lvl02param>(*bkfftlvl02, sk);
118
115
}
119
116
else if constexpr (std::is_same_v<P, lvlh2param>) {
120
- bkfftlvlh2 = std::unique_ptr<BootstrappingKeyFFT<lvlh2param>>(
121
- new (std::align_val_t (64 )) BootstrappingKeyFFT<lvlh2param>());
117
+ bkfftlvlh2 = std::make_unique<BootstrappingKeyFFT<lvlh2param>>();
122
118
bkfftgen<lvlh2param>(*bkfftlvlh2, sk);
123
119
}
124
120
else
@@ -218,18 +214,15 @@ struct EvalKey {
218
214
void emplaceiksk (const SecretKey& sk)
219
215
{
220
216
if constexpr (std::is_same_v<P, lvl10param>) {
221
- iksklvl10 = std::unique_ptr<KeySwitchingKey<lvl10param>>(
222
- new (std::align_val_t (64 )) KeySwitchingKey<lvl10param>());
217
+ iksklvl10 = std::make_unique<KeySwitchingKey<lvl10param>>();
223
218
ikskgen<lvl10param>(*iksklvl10, sk);
224
219
}
225
220
else if constexpr (std::is_same_v<P, lvl1hparam>) {
226
- iksklvl1h = std::unique_ptr<KeySwitchingKey<lvl1hparam>>(
227
- new (std::align_val_t (64 )) KeySwitchingKey<lvl1hparam>());
221
+ iksklvl1h = std::make_unique<KeySwitchingKey<lvl1hparam>>();
228
222
ikskgen<lvl1hparam>(*iksklvl1h, sk);
229
223
}
230
224
else if constexpr (std::is_same_v<P, lvl20param>) {
231
- iksklvl20 = std::unique_ptr<KeySwitchingKey<lvl20param>>(
232
- new (std::align_val_t (64 )) KeySwitchingKey<lvl20param>());
225
+ iksklvl20 = std::make_unique<KeySwitchingKey<lvl20param>>();
233
226
ikskgen<lvl20param>(*iksklvl20, sk);
234
227
}
235
228
else if constexpr (std::is_same_v<P, lvl2hparam>) {
@@ -238,18 +231,15 @@ struct EvalKey {
238
231
ikskgen<lvl2hparam>(*iksklvl2h, sk);
239
232
}
240
233
else if constexpr (std::is_same_v<P, lvl21param>) {
241
- iksklvl21 = std::unique_ptr<KeySwitchingKey<lvl21param>>(
242
- new (std::align_val_t (64 )) KeySwitchingKey<lvl21param>());
234
+ iksklvl21 = std::make_unique<KeySwitchingKey<lvl21param>>();
243
235
ikskgen<lvl21param>(*iksklvl21, sk);
244
236
}
245
237
else if constexpr (std::is_same_v<P, lvl22param>) {
246
- iksklvl22 = std::unique_ptr<KeySwitchingKey<lvl22param>>(
247
- new (std::align_val_t (64 )) KeySwitchingKey<lvl22param>());
238
+ iksklvl22 = std::make_unique<KeySwitchingKey<lvl22param>>();
248
239
ikskgen<lvl22param>(*iksklvl22, sk);
249
240
}
250
241
else if constexpr (std::is_same_v<P, lvl31param>) {
251
- iksklvl31 = std::unique_ptr<KeySwitchingKey<lvl31param>>(
252
- new (std::align_val_t (64 )) KeySwitchingKey<lvl31param>());
242
+ iksklvl31 = std::make_unique<KeySwitchingKey<lvl31param>>();
253
243
ikskgen<lvl31param>(*iksklvl31, sk);
254
244
}
255
245
else
@@ -300,9 +290,7 @@ struct EvalKey {
300
290
{
301
291
if constexpr (std::is_same_v<P, lvl21param>) {
302
292
subprivksklvl21[key] =
303
- std::unique_ptr<SubsetPrivateKeySwitchingKey<lvl21param>>(
304
- new (std::align_val_t (64 ))
305
- SubsetPrivateKeySwitchingKey<lvl21param>());
293
+ std::make_unique<SubsetPrivateKeySwitchingKey<lvl21param>>();
306
294
subprivkskgen<lvl21param>(*subprivksklvl21[key], func, sk);
307
295
}
308
296
else
0 commit comments