HElib: src/FHEContext.h File Reference

HElib 1.0 Implementing Homomorphic Encryption

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Friends Pages
Classes | Functions | Variables
FHEContext.h File Reference

Keeps the parameters of an instance of the cryptosystem. More...

`#include <NTL/xdouble.h>`
`#include "PAlgebra.h"`
`#include "CModulus.h"`
`#include "IndexSet.h"`

Go to the source code of this file.

## Classes
class | FHEcontext
| Maintaining the parameters. More...

## Functions
long | FindM (long k, long L, long c, long p, long d, long s, long chosen_m, bool verbose=false)
| Returns smallest parameter m satisfying various constraints: More...
void | writeContextBase (ostream &s, const FHEcontext &context)
| write [m p r] data
void | readContextBase (istream &s, unsigned &m, unsigned &p, unsigned &r)
| read [m p r] data, needed to construct context
Convenience routines for generating the modulus chain
double | AddPrimesBySize (FHEcontext &context, double totalSize, bool special=false)
| Adds to the chain primes whose product is at least e^totalSize, returns natural log of the product of all added primes.
double | AddPrimesByNumber (FHEcontext &context, long nPrimes, long startAt=1, bool special=false)
| Adds n primes to the chain returns natural log of the product of all added primes.
void | buildModChain (FHEcontext &context, long nLvls, long c=3)
| Build modulus chain for nLvls levels, using c digits in key-switching.

## Variables
FHEcontext * | activeContext

## Detailed Description

Keeps the parameters of an instance of the cryptosystem.

## Function Documentation

long FindM | ( | long | k,
|  | long | L,
|  | long | c,
|  | long | p,
|  | long | d,
|  | long | s,
|  | long | chosen_m,
|  | bool | verbose = `false`
| ) |  |

Returns smallest parameter m satisfying various constraints:

Parameters

  k | security parameter
  L | number of levels
  c | number of columns in key switching matrices
  p | characteristic of plaintext space
  d | embedding degree (d ==0 or d==1 => no constraint)
  s | at least that many plaintext slots
  chosen_m | preselected value of m (0 => not preselected) Fails with an error message if no suitable m is found prints an informative message if verbose == true