Documentation
¶
Overview ¶
Package debug provides deterministic operations for testing and debugging.
This package implements the same debug mode functionality as the C++ version, allowing for deterministic secret generation, polynomial coefficients, and ephemeral keys to enable cross-language compatibility testing.
Index ¶
- func DebugLog(message string)
- func GetDeterministicBaseAuthCode() string
- func GetDeterministicEphemeralSecret() []byte
- func GetDeterministicMainSecret() *big.Int
- func GetDeterministicPolynomialCoefficient() *big.Int
- func GetDeterministicRandomBytes(length int) []byte
- func GetDeterministicRandomScalar() *big.Int
- func GetDeterministicSecret() *big.Int
- func IsDebugModeEnabled() bool
- func SecureRandom(max *big.Int) (*big.Int, error)
- func SecureRandomCoefficient(max *big.Int) (*big.Int, error)
- func SetDebugMode(enabled bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugLog ¶
func DebugLog(message string)
DebugLog prints a debug message if debug mode is enabled
func GetDeterministicBaseAuthCode ¶
func GetDeterministicBaseAuthCode() string
GetDeterministicBaseAuthCode returns a fixed base auth code for deterministic testing
func GetDeterministicEphemeralSecret ¶
func GetDeterministicEphemeralSecret() []byte
GetDeterministicEphemeralSecret returns a fixed ephemeral secret for reproducible Noise handshakes
func GetDeterministicMainSecret ¶
GetDeterministicMainSecret returns a large deterministic scalar for the main secret r This is a fixed large value that properly exercises the cryptographic operations
func GetDeterministicPolynomialCoefficient ¶
GetDeterministicPolynomialCoefficient returns deterministic polynomial coefficients These should be sequential: 1, 2, 3, ... for reproducible Shamir secret sharing
func GetDeterministicRandomBytes ¶
GetDeterministicRandomBytes returns deterministic bytes for testing
func GetDeterministicRandomScalar ¶
GetDeterministicRandomScalar returns a deterministic scalar for testing In debug mode, the main secret r should always be 1
func GetDeterministicSecret ¶
GetDeterministicSecret returns the same value as the main secret for consistency
func IsDebugModeEnabled ¶
func IsDebugModeEnabled() bool
IsDebugModeEnabled returns whether debug mode is currently enabled
func SecureRandom ¶
SecureRandom provides either deterministic or cryptographically secure random generation This is the main function that should be used throughout the codebase for random number generation
func SecureRandomCoefficient ¶
SecureRandomCoefficient provides deterministic or secure random coefficients for Shamir secret sharing
func SetDebugMode ¶
func SetDebugMode(enabled bool)
SetDebugMode enables or disables debug mode for deterministic operations
Types ¶
This section is empty.