Skip to content

Commit

Permalink
Merge pull request google#1062 from ZenithalHourlyRate:example-openfh…
Browse files Browse the repository at this point in the history
…e-context

PiperOrigin-RevId: 688195620
  • Loading branch information
copybara-github committed Oct 21, 2024
2 parents 49aa5b2 + 2368fd3 commit 6620b3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 3 additions & 10 deletions docs/content/en/docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,12 @@ Where `dot_product_main.cpp` is a new file containing
#include "heir_output.h"

int main(int argc, char *argv[]) {
CCParams<CryptoContextBGVRNS> parameters;
// TODO(#661): replace this setup with a HEIR-generated helper function
parameters.SetMultiplicativeDepth(2);
parameters.SetPlaintextModulus(65537);
CryptoContext<DCRTPoly> cryptoContext = GenCryptoContext(parameters);
cryptoContext->Enable(PKE);
cryptoContext->Enable(KEYSWITCH);
cryptoContext->Enable(LEVELEDSHE);
CryptoContext<DCRTPoly> cryptoContext = dot_product__generate_crypto_context();

KeyPair<DCRTPoly> keyPair;
keyPair = cryptoContext->KeyGen();
cryptoContext->EvalMultKeyGen(keyPair.secretKey);
cryptoContext->EvalRotateKeyGen(keyPair.secretKey, {1, 2, 4, 7});

cryptoContext = dot_product__configure_crypto_context(cryptoContext, keyPair.secretKey);

int32_t n = cryptoContext->GetCryptoParameters()
->GetElementParams()
Expand Down
2 changes: 0 additions & 2 deletions tests/Examples/openfhe/dot_product_8_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ namespace heir {
namespace openfhe {

TEST(DotProduct8Test, RunTest) {
// TODO(#661): Generate a helper function to set up CryptoContext based on
// what is used in the generated code.
auto cryptoContext = dot_product__generate_crypto_context();
auto keyPair = cryptoContext->KeyGen();
auto publicKey = keyPair.publicKey;
Expand Down

0 comments on commit 6620b3f

Please sign in to comment.