From 9fc376c19488be2bfd213780ee06789754f4b2c2 Mon Sep 17 00:00:00 2001 From: Kim Laine Date: Wed, 27 Nov 2019 18:17:38 -0800 Subject: [PATCH] Faster validity checks in evaluator for _plain operations' plaintext inputs --- native/src/seal/evaluator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/src/seal/evaluator.cpp b/native/src/seal/evaluator.cpp index ebebcd823..0bea24ac2 100644 --- a/native/src/seal/evaluator.cpp +++ b/native/src/seal/evaluator.cpp @@ -1705,7 +1705,7 @@ namespace seal { throw invalid_argument("encrypted is not valid for encryption parameters"); } - if (!is_valid_for(plain, context_)) + if (!is_metadata_valid_for(plain, context_) || !is_buffer_valid(plain)) { throw invalid_argument("plain is not valid for encryption parameters"); } @@ -1784,7 +1784,7 @@ namespace seal { throw invalid_argument("encrypted is not valid for encryption parameters"); } - if (!is_valid_for(plain, context_)) + if (!is_metadata_valid_for(plain, context_) || !is_buffer_valid(plain)) { throw invalid_argument("plain is not valid for encryption parameters"); } @@ -1864,7 +1864,7 @@ namespace seal { throw invalid_argument("encrypted is not valid for encryption parameters"); } - if (!is_valid_for(plain, context_)) + if (!is_metadata_valid_for(plain, context_) || !is_buffer_valid(plain)) { throw invalid_argument("plain is not valid for encryption parameters"); }