crypto

package
v0.0.0-...-d636a2f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEMCiphertextSize = 1568 // ML-KEM-1024 Ciphertext
	X25519PubKeySize  = 32   // Standard X25519 Public Key
	NonceSize         = 12   // AES-GCM Standard Nonce

)

Variables

View Source
var EncodedVaultKey string

Functions

func ClientDecrypt

func ClientDecrypt(ciphertext, combinedSecret []byte, sid string) ([]byte, error)

ClientDecrypt (Client Side)

func ClientEncrypt

func ClientEncrypt(serverPubKeyBytes, plaintext []byte, sid string) ([]byte, []byte, error)

ClientEncrypt (Client Side)

func InitVault

func InitVault()

func ServerDecrypt

func ServerDecrypt(dk *HybridPrivateKey, blob []byte, sid string) ([]byte, []byte, error)

ServerDecrypt (Server Side)

func ServerEncrypt

func ServerEncrypt(combinedSecret, plaintext []byte, sid string) ([]byte, error)

ServerEncrypt (Server Side)

Types

type HybridPrivateKey

type HybridPrivateKey struct {
	MLKEM  *mlkem.DecapsulationKey1024
	X25519 *ecdh.PrivateKey
}

HybridPrivateKey holds both the Post-Quantum and Classical keys

var VaultKey *HybridPrivateKey