API Reference

The MetaMUI Crypto Primitives library provides a consistent API across all 10 platforms (C, C#, Go, Java, Kotlin, Python, Rust, Swift, TypeScript, WASM) for 33 cryptographic algorithms.

Platform-Specific Documentation

Common API Patterns

All platforms follow consistent patterns for ease of use:

Key Generation

# Generate keypair
keypair = Algorithm.generate_keypair()

# Access keys
public_key = keypair.public_key
private_key = keypair.private_key

Encryption/Decryption

# Encrypt
ciphertext = Algorithm.encrypt(plaintext, key)

# Decrypt
plaintext = Algorithm.decrypt(ciphertext, key)

Signing/Verification

# Sign
signature = Algorithm.sign(message, private_key)

# Verify
is_valid = Algorithm.verify(signature, message, public_key)

Hashing

# Hash data
hash = Algorithm.hash(data)

# Hash with key (HMAC)
mac = Algorithm.hmac(data, key)

Algorithm Categories

πŸ” Post-Quantum Algorithms

✍️ Digital Signatures

πŸ”’ Symmetric Encryption

#️⃣ Hash Functions

πŸ”‘ Key Derivation

πŸ”§ Additional Algorithms

Error Handling

All platforms use consistent error handling:

Python

try:
    result = Algorithm.operation(data)
except CryptoError as e:
    print(f"Crypto error: {e}")

Rust

match algorithm.operation(data) {
    Ok(result) => println!("Success: {:?}", result),
    Err(e) => eprintln!("Error: {}", e),
}

TypeScript

try {
    const result = await Algorithm.operation(data);
} catch (error) {
    if (error instanceof CryptoError) {
        console.error('Crypto error:', error.message);
    }
}

Serialization

All platforms support consistent serialization formats:

Security Considerations

All implementations follow security best practices:

  1. Constant-time operations for secret data
  2. Secure memory clearing after use
  3. Input validation to prevent attacks
  4. Side-channel resistance in all operations
  5. No logging of sensitive data

Performance

Each platform is optimized for its environment:


For detailed platform-specific documentation, select your platform above or browse the complete API documentation.