cryptutil

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 7 Imported by: 6

README

GoDoc CI

cryptutil

DEPRECATED: This package has been renamed and moved to github.com/BottleFmt/gobottle. Please update your imports:

go get github.com/BottleFmt/gobottle@latest

Then change your imports from github.com/KarpelesLab/cryptutil to github.com/BottleFmt/gobottle.

A comprehensive Go cryptographic utility library providing high-level APIs for encryption, signing, and key management. Supports both classical (ECDSA, Ed25519, RSA) and post-quantum (ML-KEM, ML-DSA) cryptography.

Installation

go get github.com/KarpelesLab/cryptutil

Requires Go 1.24 or later.

Features

  • Bottle: Layered message containers with encryption and signatures
  • ML-KEM: Post-quantum encryption (ML-KEM-768, ML-KEM-1024) with optional X25519 hybrid mode
  • ML-DSA: Post-quantum signatures (ML-DSA-44, ML-DSA-65, ML-DSA-87)
  • SLH-DSA: Stateless hash-based post-quantum signatures (12 parameter sets)
  • ECDH Encryption: Simple message encryption to ECDSA/ECDH keys
  • IDCard: Identity management with sub-keys and key purposes
  • Keychain: Secure key storage and management
  • Membership: Cryptographically signed group memberships

Bottle

Bottles are versatile containers for arbitrary data that support multiple layers of encryption and signatures. They can be serialized as CBOR or JSON.

Creating and Opening Bottles
import (
    "crypto/rand"
    "github.com/KarpelesLab/cryptutil"
)

// Create a bottle with a message
bottle := cryptutil.NewBottle([]byte("secret message"))

// Encrypt for one or more recipients (any recipient can decrypt)
bottle.Encrypt(rand.Reader, bobPublicKey, alicePublicKey)

// Wrap in another layer to include encryption metadata in signature
bottle.BottleUp()

// Sign the bottle
bottle.Sign(rand.Reader, senderPrivateKey)

// Open the bottle (Bob decrypts)
opener, err := cryptutil.NewOpener(bobPrivateKey)
message, info, err := opener.Open(bottle)

// Check who signed it
if info.SignedBy(senderPublicKey) {
    fmt.Println("Verified signature from sender")
}
fmt.Printf("Decryption layers: %d\n", info.Decryption)
Bottle with Structured Data
// Marshal Go structs directly into bottles
type MyData struct {
    Name  string `json:"name"`
    Value int    `json:"value"`
}

// CBOR encoding (compact, binary)
bottle, err := cryptutil.Marshal(MyData{Name: "test", Value: 42})

// JSON encoding
bottle, err := cryptutil.MarshalJson(MyData{Name: "test", Value: 42})

// Unmarshal from bottle
var data MyData
opener := cryptutil.MustOpener(privateKey)
info, err := opener.Unmarshal(bottle, &data)
Opening Encoded Bottles
// Open CBOR-encoded bottle directly
message, info, err := opener.OpenCbor(cborBytes)

// Open from HTTP request (handles Content-Type)
message, info, err := opener.OpenHttp(httpRequest)

ML-KEM Post-Quantum Encryption

ML-KEM (formerly CRYSTALS-Kyber) provides quantum-resistant key encapsulation. The library supports hybrid mode combining ML-KEM with X25519 for defense-in-depth.

Key Generation
// Generate ML-KEM-768 hybrid key (recommended)
privateKey, err := cryptutil.GenerateMLKEMKey(rand.Reader, true)

// Generate ML-KEM-768 pure (no X25519)
privateKey, err := cryptutil.GenerateMLKEMKey(rand.Reader, false)

// Generate ML-KEM-1024 for higher security
privateKey, err := cryptutil.GenerateMLKEMKey1024(rand.Reader, true)
Encryption and Decryption
// Hybrid encryption (X25519 + ML-KEM)
ciphertext, err := cryptutil.HybridEncrypt(rand.Reader, plaintext, publicKey)

// Pure ML-KEM encryption
ciphertext, err := cryptutil.MLKEMEncrypt(rand.Reader, plaintext, publicKey)

// Decryption (auto-detects hybrid vs pure)
plaintext, err := cryptutil.MLKEMDecrypt(ciphertext, privateKey)
Using ML-KEM with Bottles
// ML-KEM keys work seamlessly with bottles
mlkemKey, _ := cryptutil.GenerateMLKEMKey(rand.Reader, true)

bottle := cryptutil.NewBottle([]byte("quantum-safe message"))
bottle.Encrypt(rand.Reader, mlkemKey.Public())

// Mixed recipients (classical + post-quantum)
bottle.Encrypt(rand.Reader, ecdsaKey.Public(), mlkemKey.Public())
Key Serialization
// Marshal to PKCS#8 (private) / PKIX (public)
privDER, err := privateKey.MarshalPKCS8PrivateKey()
pubDER, err := publicKey.MarshalPKIXPublicKey()

// Parse from DER
privateKey, err := cryptutil.ParseMLKEMPrivateKey(privDER)
publicKey, err := cryptutil.ParseMLKEMPublicKey(pubDER)

ML-DSA Post-Quantum Signatures

ML-DSA (Module-Lattice Digital Signature Algorithm, formerly CRYSTALS-Dilithium) provides quantum-resistant digital signatures. Three security levels are supported:

  • ML-DSA-44: NIST security level 2 (comparable to AES-128)
  • ML-DSA-65: NIST security level 3 (comparable to AES-192)
  • ML-DSA-87: NIST security level 5 (comparable to AES-256)
Key Generation
import "github.com/KarpelesLab/mldsa"

// Generate ML-DSA-65 key (recommended)
key, err := mldsa.GenerateKey65(rand.Reader)

// Other variants
key44, err := mldsa.GenerateKey44(rand.Reader)  // Level 2
key87, err := mldsa.GenerateKey87(rand.Reader)  // Level 5
Signing and Verification
// Sign a message (ML-DSA signs messages directly, no pre-hashing)
signature, err := cryptutil.Sign(rand.Reader, key, message)

// Verify signature
err = cryptutil.Verify(key.PublicKey(), message, signature)

// Sign with context for domain separation
opts := &mldsa.SignerOpts{Context: []byte("my-application")}
signature, err := cryptutil.Sign(rand.Reader, key, message, opts)
err = cryptutil.Verify(key.PublicKey(), message, signature, opts)
Using ML-DSA with Bottles
// ML-DSA keys work seamlessly with bottles
key, _ := mldsa.GenerateKey65(rand.Reader)

bottle := cryptutil.NewBottle([]byte("quantum-safe signed message"))
bottle.Sign(rand.Reader, key)

// Verify on open
opener := cryptutil.MustOpener()
msg, info, err := opener.Open(bottle)
if info.SignedBy(key.PublicKey()) {
    fmt.Println("Verified ML-DSA signature")
}
Key Serialization
// Marshal to PKCS#8 (private) / PKIX (public)
privDER, err := cryptutil.MarshalMLDSAPrivateKey(key)
pubDER, err := cryptutil.MarshalPKIXPublicKey(key.PublicKey())

// Parse from DER
privateKey, err := cryptutil.ParseMLDSAPrivateKey(privDER)
publicKey, err := cryptutil.ParsePKIXPublicKey(pubDER)

SLH-DSA Post-Quantum Signatures

SLH-DSA (Stateless Hash-Based Digital Signature Algorithm, also known as SPHINCS+) provides quantum-resistant digital signatures based on hash functions. It offers strong security guarantees without relying on lattice assumptions. Twelve parameter sets are supported:

SHA2-based:

  • SLH-DSA-SHA2-128s/128f: NIST security level 1
  • SLH-DSA-SHA2-192s/192f: NIST security level 3
  • SLH-DSA-SHA2-256s/256f: NIST security level 5

SHAKE-based:

  • SLH-DSA-SHAKE-128s/128f: NIST security level 1
  • SLH-DSA-SHAKE-192s/192f: NIST security level 3
  • SLH-DSA-SHAKE-256s/256f: NIST security level 5

The "s" variants are optimized for smaller signatures, while "f" variants are optimized for faster signing.

Key Generation
import "github.com/KarpelesLab/slhdsa"

// Generate SLH-DSA-SHA2-128s key (small signatures)
key, err := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_128s)

// Generate SLH-DSA-SHA2-128f key (fast signing)
key, err := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_128f)

// Higher security levels
key192, err := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_192s)
key256, err := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_256s)

// SHAKE-based variants
keyShake, err := slhdsa.GenerateKey(rand.Reader, slhdsa.SHAKE_128s)
Signing and Verification
// Sign a message (SLH-DSA signs messages directly, no pre-hashing)
signature, err := cryptutil.Sign(rand.Reader, key, message)

// Verify signature
err = cryptutil.Verify(key.Public(), message, signature)

// Sign with context for domain separation
opts := &slhdsa.Options{Context: []byte("my-application")}
signature, err := cryptutil.Sign(rand.Reader, key, message, opts)
err = cryptutil.Verify(key.Public(), message, signature, opts)
Using SLH-DSA with Bottles
// SLH-DSA keys work seamlessly with bottles
key, _ := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_128s)

bottle := cryptutil.NewBottle([]byte("hash-based signed message"))
bottle.Sign(rand.Reader, key)

// Verify on open
opener := cryptutil.MustOpener()
msg, info, err := opener.Open(bottle)
if info.SignedBy(key.Public()) {
    fmt.Println("Verified SLH-DSA signature")
}
Key Serialization
// Marshal to PKCS#8 (private) / PKIX (public)
privDER, err := cryptutil.MarshalSLHDSAPrivateKey(key)
pubDER, err := cryptutil.MarshalPKIXPublicKey(key.Public())

// Parse from DER
privateKey, err := cryptutil.ParseSLHDSAPrivateKey(privDER)
publicKey, err := cryptutil.ParsePKIXPublicKey(pubDER)

ECDH Message Encryption

Simple encryption to ECDSA/ECDH keys, supporting TPM and HSM backends through the ECDHHandler interface.

// Encrypt to an ECDH public key
ciphertext, err := cryptutil.ECDHEncrypt(rand.Reader, plaintext, ecdhPublicKey)

// Decrypt with private key (or any ECDHHandler)
plaintext, err := cryptutil.ECDHDecrypt(ciphertext, ecdhPrivateKey)

IDCard

IDCards allow entities to declare sub-keys with specific purposes (signing, decryption) and manage key lifecycles.

// Create an IDCard for a signing key
idcard, err := cryptutil.NewIDCard(signingKey.Public())

// Add metadata
idcard.Meta = map[string]string{"name": "Alice", "email": "alice@example.com"}

// Configure key purposes
idcard.SetKeyPurposes(signingKey.Public(), "sign", "decrypt")

// Add a dedicated encryption key
idcard.SetKeyPurposes(encryptionKey.Public(), "decrypt")
idcard.SetKeyDuration(encryptionKey.Public(), 365*24*time.Hour) // 1 year expiry

// Sign and serialize the IDCard
signedIDCard, err := idcard.Sign(rand.Reader, signingKey)

// Load and verify an IDCard
var loaded cryptutil.IDCard
err = loaded.UnmarshalBinary(signedIDCard)

// Check key purposes
err = loaded.TestKeyPurpose(someKey, "sign")
if err != nil {
    fmt.Println("Key not authorized for signing")
}

// Get all keys for a purpose
decryptKeys := loaded.GetKeys("decrypt")

Keychain

Keychain provides secure storage for private keys, indexed by their public key.

// Create a keychain
kc := cryptutil.NewKeychain()

// Add keys (supports ECDSA, Ed25519, RSA, ML-KEM)
kc.AddKey(ecdsaPrivateKey)
kc.AddKey(ed25519PrivateKey)
kc.AddKey(mlkemPrivateKey)

// Add multiple keys at once
kc.AddKeys(key1, key2, key3)

// Retrieve keys by public key
privateKey, err := kc.GetKey(publicKey)
signer, err := kc.GetSigner(publicKey)

// Sign with a specific key
signature, err := kc.Sign(rand.Reader, publicKey, message)

// Iterate over keys
for signer := range kc.Signers {
    fmt.Printf("Signer: %T\n", signer.Public())
}

// Use keychain with Opener
opener, err := cryptutil.NewOpener(kc)

Membership

Memberships provide cryptographically signed group affiliations.

// Create a membership
membership := cryptutil.NewMembership(memberIDCard, groupPublicKey)
membership.Info["role"] = "admin"

// Sign with group owner's key
err = membership.Sign(rand.Reader, groupOwnerKey)

// Verify membership
err = membership.Verify(groupIDCard)

// Add to IDCard
idcard.UpdateGroups([][]byte{membershipBytes})

Signing and Verification

Low-level signing utilities that handle algorithm-specific requirements automatically.

// Sign a message (hashing handled automatically)
signature, err := cryptutil.Sign(rand.Reader, privateKey, message)

// Verify a signature
err = cryptutil.Verify(publicKey, message, signature)
if err != nil {
    fmt.Println("Signature verification failed")
}

Utility Functions

PKIX Key Marshaling

Extended PKIX support including ML-KEM and ML-DSA keys:

// Marshal any public key to PKIX format
der, err := cryptutil.MarshalPKIXPublicKey(publicKey)

// Parse PKIX public key (supports ML-KEM, ML-DSA)
publicKey, err := cryptutil.ParsePKIXPublicKey(der)
Short Buffer Encryption

Encrypt small buffers (like AES keys) to various key types:

// Encrypt a short buffer to any supported public key
encrypted, err := cryptutil.EncryptShortBuffer(rand.Reader, aesKey, recipientPublicKey)

// Decrypt
decrypted, err := cryptutil.DecryptShortBuffer(encrypted, recipientPrivateKey)
Memory Clearing

Securely clear sensitive data from memory:

privateKeyBytes := make([]byte, 32)
defer cryptutil.MemClr(privateKeyBytes)
Hashing

Helper for single or multi-level hashing:

// Single hash
digest := cryptutil.Hash(data, sha256.New)

// Multi-level hash (hash of hash)
digest := cryptutil.Hash(data, sha256.New, sha256.New)

Supported Key Types

Type Signing Encryption Post-Quantum
ECDSA (P-256, P-384, P-521) ✓ (via ECDH)
Ed25519 ✓ (via X25519)
RSA
ML-KEM-768
ML-KEM-1024
ML-KEM + X25519 (Hybrid)
ML-DSA-44/65/87
SLH-DSA (12 variants)

Error Handling

var (
    ErrNoAppropriateKey   // No key available to decrypt
    ErrVerifyFailed       // Signature verification failed
    ErrKeyNotFound        // Key not found in keychain/IDCard
    ErrGroupNotFound      // Group not found in IDCard
    ErrKeyUnfit           // Key not authorized for the operation
    ErrEncryptNoRecipient // No valid recipient for encryption
)

License

See LICENSE file.

Documentation

Overview

Package cryptutil provides cryptographic utilities for secure message handling.

Deprecated: This package has been renamed and moved to a new location. Please update your imports to use github.com/BottleFmt/gobottle instead.

To migrate:

go get github.com/BottleFmt/gobottle@latest

Then update your imports from:

import "github.com/KarpelesLab/cryptutil"

To:

import "github.com/BottleFmt/gobottle"

Index

Constants

View Source
const AES = gobottle.AES

Deprecated: Use gobottle.AES instead.

View Source
const CborBottle = gobottle.CborBottle

Deprecated: Use gobottle.CborBottle instead.

View Source
const ClearText = gobottle.ClearText

Deprecated: Use gobottle.ClearText instead.

View Source
const JsonBottle = gobottle.JsonBottle

Deprecated: Use gobottle.JsonBottle instead.

View Source
const MLDSA44 = gobottle.MLDSA44

Deprecated: Use gobottle.MLDSA44 instead.

View Source
const MLDSA65 = gobottle.MLDSA65

Deprecated: Use gobottle.MLDSA65 instead.

View Source
const MLDSA87 = gobottle.MLDSA87

Deprecated: Use gobottle.MLDSA87 instead.

View Source
const MLKEM1024 = gobottle.MLKEM1024

Deprecated: Use gobottle.MLKEM1024 instead.

View Source
const MLKEM768 = gobottle.MLKEM768

Deprecated: Use gobottle.MLKEM768 instead.

Variables

View Source
var EmptyOpener = gobottle.EmptyOpener

Deprecated: Use gobottle.EmptyOpener instead.

View Source
var ErrEncryptNoRecipient = gobottle.ErrEncryptNoRecipient

Deprecated: Use gobottle.ErrEncryptNoRecipient instead.

View Source
var ErrGroupNotFound = gobottle.ErrGroupNotFound

Deprecated: Use gobottle.ErrGroupNotFound instead.

View Source
var ErrKeyNotFound = gobottle.ErrKeyNotFound

Deprecated: Use gobottle.ErrKeyNotFound instead.

View Source
var ErrKeyUnfit = gobottle.ErrKeyUnfit

Deprecated: Use gobottle.ErrKeyUnfit instead.

View Source
var ErrNoAppropriateKey = gobottle.ErrNoAppropriateKey

Deprecated: Use gobottle.ErrNoAppropriateKey instead.

View Source
var ErrVerifyFailed = gobottle.ErrVerifyFailed

Deprecated: Use gobottle.ErrVerifyFailed instead.

Functions

func DecryptShortBuffer deprecated added in v0.1.1

func DecryptShortBuffer(k []byte, rcvd any) ([]byte, error)

Deprecated: Use gobottle.DecryptShortBuffer instead.

func ECDHDecrypt deprecated

func ECDHDecrypt(data []byte, privateKey ECDHHandler) ([]byte, error)

Deprecated: Use gobottle.ECDHDecrypt instead.

func ECDHEncrypt deprecated

func ECDHEncrypt(rnd io.Reader, data []byte, remote *ecdh.PublicKey) ([]byte, error)

Deprecated: Use gobottle.ECDHEncrypt instead.

func EncryptShortBuffer deprecated added in v0.1.1

func EncryptShortBuffer(rand io.Reader, k []byte, rcvd crypto.PublicKey) ([]byte, error)

Deprecated: Use gobottle.EncryptShortBuffer instead.

func Hash deprecated added in v0.1.1

func Hash(b []byte, alg ...func() hash.Hash) []byte

Deprecated: Use gobottle.Hash instead.

func HybridEncrypt deprecated added in v0.3.0

func HybridEncrypt(rnd io.Reader, data []byte, remote *MLKEMPublicKey) ([]byte, error)

Deprecated: Use gobottle.HybridEncrypt instead.

func MLKEMDecrypt deprecated added in v0.3.0

func MLKEMDecrypt(data []byte, privateKey *MLKEMPrivateKey) ([]byte, error)

Deprecated: Use gobottle.MLKEMDecrypt instead.

func MLKEMEncrypt deprecated added in v0.3.0

func MLKEMEncrypt(rnd io.Reader, data []byte, remote *MLKEMPublicKey) ([]byte, error)

Deprecated: Use gobottle.MLKEMEncrypt instead.

func MarshalMLDSAPrivateKey deprecated added in v0.3.0

func MarshalMLDSAPrivateKey(key crypto.Signer) ([]byte, error)

Deprecated: Use gobottle.MarshalMLDSAPrivateKey instead.

func MarshalMLDSAPublicKey deprecated added in v0.3.0

func MarshalMLDSAPublicKey(pub crypto.PublicKey) ([]byte, error)

Deprecated: Use gobottle.MarshalMLDSAPublicKey instead.

func MarshalMLKEMPrivateKey deprecated added in v0.3.0

func MarshalMLKEMPrivateKey(k *MLKEMPrivateKey) []byte

Deprecated: Use gobottle.MarshalMLKEMPrivateKey instead.

func MarshalMLKEMPublicKey deprecated added in v0.3.0

func MarshalMLKEMPublicKey(k *MLKEMPublicKey) []byte

Deprecated: Use gobottle.MarshalMLKEMPublicKey instead.

func MarshalPKIXPublicKey deprecated added in v0.3.0

func MarshalPKIXPublicKey(pub crypto.PublicKey) ([]byte, error)

Deprecated: Use gobottle.MarshalPKIXPublicKey instead.

func MarshalSLHDSAPrivateKey deprecated added in v0.3.0

func MarshalSLHDSAPrivateKey(key *slhdsa.PrivateKey) ([]byte, error)

Deprecated: Use gobottle.MarshalSLHDSAPrivateKey instead.

func MarshalSLHDSAPublicKey deprecated added in v0.3.0

func MarshalSLHDSAPublicKey(pub crypto.PublicKey) ([]byte, error)

Deprecated: Use gobottle.MarshalSLHDSAPublicKey instead.

func MemClr deprecated added in v0.1.1

func MemClr(b []byte)

Deprecated: Use gobottle.MemClr instead.

func ParseMLDSAPrivateKey deprecated added in v0.3.0

func ParseMLDSAPrivateKey(der []byte) (crypto.Signer, error)

Deprecated: Use gobottle.ParseMLDSAPrivateKey instead.

func ParseMLDSAPublicKey deprecated added in v0.3.0

func ParseMLDSAPublicKey(der []byte) (crypto.PublicKey, error)

Deprecated: Use gobottle.ParseMLDSAPublicKey instead.

func ParseSLHDSAPrivateKey deprecated added in v0.3.0

func ParseSLHDSAPrivateKey(der []byte) (*slhdsa.PrivateKey, error)

Deprecated: Use gobottle.ParseSLHDSAPrivateKey instead.

func ParseSLHDSAPublicKey deprecated added in v0.3.0

func ParseSLHDSAPublicKey(der []byte) (*slhdsa.PublicKey, error)

Deprecated: Use gobottle.ParseSLHDSAPublicKey instead.

func Sign deprecated added in v0.1.4

func Sign(rand io.Reader, key crypto.Signer, buf []byte, opts ...crypto.SignerOpts) ([]byte, error)

Deprecated: Use gobottle.Sign instead.

func Verify deprecated added in v0.1.4

func Verify(key crypto.PublicKey, buf, sig []byte, opts ...crypto.SignerOpts) error

Deprecated: Use gobottle.Verify instead.

Types

type Bottle deprecated added in v0.1.1

type Bottle = gobottle.Bottle

Deprecated: Use gobottle.Bottle instead.

func AsCborBottle deprecated added in v0.1.3

func AsCborBottle(data []byte) *Bottle

Deprecated: Use gobottle.AsCborBottle instead.

func AsJsonBottle deprecated added in v0.1.3

func AsJsonBottle(data []byte) *Bottle

Deprecated: Use gobottle.AsJsonBottle instead.

func Marshal deprecated added in v0.2.1

func Marshal(data any) (*Bottle, error)

Deprecated: Use gobottle.Marshal instead.

func MarshalJson deprecated added in v0.2.2

func MarshalJson(data any) (*Bottle, error)

Deprecated: Use gobottle.MarshalJson instead.

func NewBottle deprecated added in v0.1.1

func NewBottle(data []byte) *Bottle

Deprecated: Use gobottle.NewBottle instead.

type ECDHHandler deprecated

type ECDHHandler = gobottle.ECDHHandler

Deprecated: Use gobottle.ECDHHandler instead.

type IDCard deprecated added in v0.1.1

type IDCard = gobottle.IDCard

Deprecated: Use gobottle.IDCard instead.

func NewIDCard deprecated added in v0.1.1

func NewIDCard(k crypto.PublicKey) (*IDCard, error)

Deprecated: Use gobottle.NewIDCard instead.

type Keychain deprecated added in v0.2.11

type Keychain = gobottle.Keychain

Deprecated: Use gobottle.Keychain instead.

func NewKeychain deprecated added in v0.2.11

func NewKeychain() *Keychain

Deprecated: Use gobottle.NewKeychain instead.

type MLDSAVariant deprecated added in v0.3.0

type MLDSAVariant = gobottle.MLDSAVariant

Deprecated: Use gobottle.MLDSAVariant instead.

type MLKEMPrivateKey deprecated added in v0.3.0

type MLKEMPrivateKey = gobottle.MLKEMPrivateKey

Deprecated: Use gobottle.MLKEMPrivateKey instead.

func GenerateMLKEMKey deprecated added in v0.3.0

func GenerateMLKEMKey(rand io.Reader, hybrid bool) (*MLKEMPrivateKey, error)

Deprecated: Use gobottle.GenerateMLKEMKey instead.

func GenerateMLKEMKey1024 deprecated added in v0.3.0

func GenerateMLKEMKey1024(rand io.Reader, hybrid bool) (*MLKEMPrivateKey, error)

Deprecated: Use gobottle.GenerateMLKEMKey1024 instead.

func GenerateMLKEMKey768 deprecated added in v0.3.0

func GenerateMLKEMKey768(rand io.Reader, hybrid bool) (*MLKEMPrivateKey, error)

Deprecated: Use gobottle.GenerateMLKEMKey768 instead.

func ParseMLKEMPrivateKey deprecated added in v0.3.0

func ParseMLKEMPrivateKey(der []byte) (*MLKEMPrivateKey, error)

Deprecated: Use gobottle.ParseMLKEMPrivateKey instead.

func UnmarshalMLKEMPrivateKey deprecated added in v0.3.0

func UnmarshalMLKEMPrivateKey(data []byte) (*MLKEMPrivateKey, error)

Deprecated: Use gobottle.UnmarshalMLKEMPrivateKey instead.

type MLKEMPublicKey deprecated added in v0.3.0

type MLKEMPublicKey = gobottle.MLKEMPublicKey

Deprecated: Use gobottle.MLKEMPublicKey instead.

func ParseMLKEMPublicKey deprecated added in v0.3.0

func ParseMLKEMPublicKey(der []byte) (*MLKEMPublicKey, error)

Deprecated: Use gobottle.ParseMLKEMPublicKey instead.

func UnmarshalMLKEMPublicKey deprecated added in v0.3.0

func UnmarshalMLKEMPublicKey(data []byte) (*MLKEMPublicKey, error)

Deprecated: Use gobottle.UnmarshalMLKEMPublicKey instead.

type MLKEMVariant deprecated added in v0.3.0

type MLKEMVariant = gobottle.MLKEMVariant

Deprecated: Use gobottle.MLKEMVariant instead.

type Membership deprecated added in v0.1.4

type Membership = gobottle.Membership

Deprecated: Use gobottle.Membership instead.

func NewMembership deprecated added in v0.1.4

func NewMembership(member *IDCard, key []byte) *Membership

Deprecated: Use gobottle.NewMembership instead.

type MessageFormat deprecated added in v0.1.1

type MessageFormat = gobottle.MessageFormat

Deprecated: Use gobottle.MessageFormat instead.

type MessageRecipient deprecated added in v0.1.1

type MessageRecipient = gobottle.MessageRecipient

Deprecated: Use gobottle.MessageRecipient instead.

type MessageSignature deprecated added in v0.1.1

type MessageSignature = gobottle.MessageSignature

Deprecated: Use gobottle.MessageSignature instead.

type OpenResult deprecated added in v0.1.1

type OpenResult = gobottle.OpenResult

Deprecated: Use gobottle.OpenResult instead.

func UnmarshalHttp deprecated added in v0.3.0

func UnmarshalHttp(req *http.Request, v any, keys ...any) (*OpenResult, error)

Deprecated: Use gobottle.UnmarshalHttp instead.

type Opener deprecated added in v0.1.1

type Opener = gobottle.Opener

Deprecated: Use gobottle.Opener instead.

func MustOpener deprecated added in v0.2.1

func MustOpener(keys ...any) *Opener

Deprecated: Use gobottle.MustOpener instead.

func NewOpener deprecated added in v0.1.1

func NewOpener(keys ...any) (*Opener, error)

Deprecated: Use gobottle.NewOpener instead.

type PrivateKey deprecated added in v0.2.16

type PrivateKey = gobottle.PrivateKey

Deprecated: Use gobottle.PrivateKey instead.

type PublicKeyIntf deprecated added in v0.2.17

type PublicKeyIntf = gobottle.PublicKeyIntf

Deprecated: Use gobottle.PublicKeyIntf instead.

func ParsePKIXPublicKey deprecated added in v0.3.0

func ParsePKIXPublicKey(der []byte) (PublicKeyIntf, error)

Deprecated: Use gobottle.ParsePKIXPublicKey instead.

func PublicKey deprecated added in v0.2.14

func PublicKey(privKey crypto.PrivateKey) PublicKeyIntf

Deprecated: Use gobottle.PublicKey instead.

type SubKey deprecated added in v0.1.1

type SubKey = gobottle.SubKey

Deprecated: Use gobottle.SubKey instead.