Skip to content

Incomplete Fix for Issue #110 - PREMode default causes public keys to always use Q×P basis when using HYBRID key switching #1108

@BurakKTopal

Description

@BurakKTopal

Summary

The fix in commit 64ed308 for Issue #110 never worked. The check m_PREMode != NOT_SET always passes because PREMode defaults to INDCPA, not NOT_SET.

The Bug

In rns-cryptoparameters.h:

if ((m_ksTechnique == HYBRID) && (m_PREMode != NOT_SET))
    return m_paramsQP;

In gen-cryptocontext-params-defaults.h:

constexpr ProxyReEncryptionMode PREMode = INDCPA;  // all three schemes

Since INDCPA != NOT_SET is always true, public keys always use the extended Q×P basis with HYBRID key switching, whether PRE is needed or not.

Timeline

  • Aug 3, 2022 (8e1a341): PREMode = INDCPA added as default
  • Sep 6, 2022 (64ed308): Fix attempted with m_PREMode != NOT_SET check
  • Present: Bug persists

Impact

  • Larger public keys when using HYBRID key switching
  • No security impact

Fix

https://github.com/BurakKTopal/openfhe-development/tree/BurakKTopal_issue110

  • gen-cryptocontext-params-defaults.h: Changed to PREMode = NOT_SET
  • pre-buffer.cpp: Added explicit parameters.SetPREMode(INDCPA)

All tests pass, PRE examples work.

Related

Note

We do need to look into the effect of this fix on existing, OpenFHE-based PRE implementations.

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions