Skip to content
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

SelectVariableNames: use suggested name from dialect #1225

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ZenithalHourlyRate
Copy link
Collaborator

This is inspired by #1219 and shares some code with #1219. This will generate more friendly backend code, for example, openfhe-pke emitter output becomes

CiphertextT dot_product(CryptoContextT cc, CiphertextT ct, CiphertextT ct1) {
  std::vector<int64_t> v = {0, 0, 0, 0, 0, 0, 0, 1};
  const auto& ct2 = cc->EvalMultNoRelin(ct, ct1);
  const auto& ct3 = cc->Relinearize(ct2);
  const auto& ct4 = cc->EvalRotate(ct3, 4);
  ...
}

CryptoContextT dot_product__generate_crypto_context() {
  CCParamsT params;
  params.SetMultiplicativeDepth(2);
  params.SetPlaintextModulus(4295294977);
  CryptoContextT cc = GenCryptoContext(params);
  cc->Enable(PKE);
  cc->Enable(KEYSWITCH);
  cc->Enable(LEVELEDSHE);
  return cc;
}

And all @heir//tests/Examples/openfhe/... pass with this change. However, other backend like Jaxite/TFHE-RS are relying on getIntForValue to properly function. I am not so familiar with them so mark as draft now.

@ZenithalHourlyRate ZenithalHourlyRate force-pushed the suggest-select-variable-name branch from a183d19 to de082c4 Compare December 21, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant