literals

package
v0.0.0-...-f84c444 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestObfuscator string
)

Functions

func AsconDecrypt

func AsconDecrypt(key, nonce, ciphertextAndTag []byte) ([]byte, bool)

AsconDecrypt performs ASCON-128 authenticated decryption Input: ciphertext || tag Returns: plaintext, success (false if authentication fails)

func AsconEncrypt

func AsconEncrypt(key, nonce, plaintext []byte) []byte

AsconEncrypt performs ASCON-128 authenticated encryption Returns: ciphertext || tag (ciphertext length = plaintext length, tag = 16 bytes)

func Obfuscate

func Obfuscate(rand *mathrand.Rand, file *ast.File, info *types.Info, linkStrings map[*types.Var]string, nameFunc NameProviderFunc, cfg BuilderConfig) *ast.File

Obfuscate replaces literals with obfuscated anonymous functions.

func RegisteredStrategyNames

func RegisteredStrategyNames() []string

RegisteredStrategyNames returns the identifiers of all registered literal obfuscation strategies in registration order. It is primarily used by tooling and tests to reference specific strategies without exposing the underlying implementation type.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(rand *mathrand.Rand, file *ast.File, nameFunc NameProviderFunc, cfg BuilderConfig) *Builder

func (*Builder) Finalize

func (b *Builder) Finalize(file *ast.File)

func (*Builder) ObfuscateFile

func (b *Builder) ObfuscateFile(file *ast.File, info *types.Info, linkStrings map[*types.Var]string) *ast.File

func (*Builder) ObfuscateStringLiteral

func (b *Builder) ObfuscateStringLiteral(value string, pos token.Pos) ast.Expr

type BuilderConfig

type BuilderConfig struct{}

type NameProviderFunc

type NameProviderFunc func(rand *mathrand.Rand, baseName string) string

NameProviderFunc defines a function type that generates a string based on a random source and a base name.

Jump to

Keyboard shortcuts

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