Documentation Index
Fetch the complete documentation index at: https://mintlify.com/octra-labs/pvac_hfhe_cpp/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This module provides global configuration settings for PVAC-HFHE, primarily focused on debug output control. The debug level can be configured via environment variables or programmatically.Global variables
g_dbg
Global debug level variable.Current debug level (0-2)
No debug output
Standard debug output (default)
Detailed debug output with additional information
The debug level is automatically initialized from environment variables on first use.
Functions
set_debug_level
Sets the global debug level programmatically.Desired debug level (will be clamped to range [0, 2])
Values outside the range [0, 2] are automatically clamped to the nearest valid value.
get_debug_level
Retrieves the current debug level.Current debug level (0-2)
Environment variables
PVAC_DBG
Primary environment variable for setting the debug level.This variable is checked first during initialization.
HFHE_DBG
Fallback environment variable for backward compatibility.If
PVAC_DBG is not set, HFHE_DBG will be used instead.Initialization
The debug level is initialized automatically on first access using the following logic:- Check if
PVAC_DBGenvironment variable is set - If not, check if
HFHE_DBGenvironment variable is set - If neither is set, default to level 1 (normal)
- Clamp the value to the range [0, 2]
Usage patterns
Conditional debug output
Runtime configuration
Library initialization
Best practices
For library users:
- Set the debug level early in your program’s initialization
- Use environment variables for quick testing without recompilation
- Set level 0 for production deployments
For library developers:
- Use level 1 for important operations (key generation, encryption, etc.)
- Use level 2 for detailed algorithmic steps
- Always check the debug level before expensive string formatting
Thread safety
Related
- Types - Core types and structures
- Random generation - Random number generation