slss

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package slss implements the Sparse Lattice Subset Sum problem for kMOSAIC.

Index

Constants

View Source
const (
	DomainMatrix    = "kmosaic-slss-matrix-v1"
	DomainSecret    = "kmosaic-slss-secret-v1"
	DomainError     = "kmosaic-slss-error-v1"
	DomainEphemeral = "kmosaic-slss-ephemeral-v1"
	DomainError1    = "kmosaic-slss-error1-v1"
	DomainError2    = "kmosaic-slss-error2-v1"
)

Variables

This section is empty.

Functions

func Decrypt

Decrypt decrypts an SLSS ciphertext

func DeserializePublicKey added in v1.0.1

func DeserializePublicKey(data []byte) (*kmosaic.SLSSPublicKey, error)

DeserializePublicKey deserializes SLSS public key

func Encrypt

func Encrypt(pk kmosaic.SLSSPublicKey, message []byte, params kmosaic.SLSSParams, randomness []byte) (*kmosaic.SLSSCiphertext, error)

Encrypt encrypts a message fragment using SLSS

func KeyGen

func KeyGen(params kmosaic.SLSSParams, seed []byte) (*kmosaic.SLSSKeyPair, error)

KeyGen generates SLSS key pair

func SerializePublicKey

func SerializePublicKey(pk kmosaic.SLSSPublicKey) []byte

SerializePublicKey serializes SLSS public key

Types

type SlssDebugInfo added in v1.0.2

type SlssDebugInfo struct {
	RIndices []int   `json:"r_indices"`
	RValues  []int8  `json:"r_values"`
	E1Head   []int32 `json:"e1_head"`
	E2Head   []int32 `json:"e2_head"`
	UHead    []int32 `json:"u_head"`
	VHead    []int32 `json:"v_head"`
}

DebugInfo for SLSS encryption internals

func DebugEncrypt added in v1.0.2

func DebugEncrypt(pk kmosaic.SLSSPublicKey, message []byte, params kmosaic.SLSSParams, randomness []byte) (*kmosaic.SLSSCiphertext, *SlssDebugInfo, error)

DebugEncrypt performs SLSS encryption but also returns internal debug information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL