Enterprise security.
Sovereign cryptography.

SM2/SM3/SM4-GCM. Full GB/T 32918 compliance. AIP Pioneer Program ready. Your keys, your rules.

Plaintext SM4-GCM Encrypt Ciphertext SM4-GCM Decrypt

Most agent frameworks use foreign cipher suites by default. MAREF gives you full Chinese national cryptography compliance — SM2 for signatures, SM3 for hashing, SM4-GCM for authenticated encryption. Your data sovereignty, your choice.

Your geography. Your standards.

Full Chinese national cryptography standard compliance. No foreign cipher dependency.

Encrypt + authenticate. One pass.

SM4-GCM with Galois/Counter Mode — encrypt AND authenticate in a single pass. Tampering detected before decryption.

AIP ready. Day one.

Pre-validated for the AIP Pioneer Program. Submit with confidence. No rework needed.

Cryptography that answers to you. Not a vendor.

Full GB/T 32918 compliance means your encryption meets Chinese national standards. SM2 for digital signatures and key exchange. SM3 for cryptographic hashing. SM4-GCM for authenticated symmetric encryption. No reliance on foreign cipher suites. Your security infrastructure answers to your regulatory environment.

SM4-GCM: encrypt AND authenticate. Simultaneously.

SM4-GCM implements Galois/Counter Mode on top of the SM4 block cipher. A single pass encrypts your data AND generates an authentication tag. Tampering is detected before decryption even begins. Pure Python implementation — no native dependencies, fully auditable source.

SM4-GCM encrypt / decrypt
from maref import SM4GCM

key = SM4GCM.generate_key()
cipher = SM4GCM(key)

# Encrypt + authenticate in one pass
ciphertext, tag = cipher.encrypt(
    b"agent communication data",
    aad=b"associated metadata"
)

# Decrypt + verify in one pass
plaintext = cipher.decrypt(
    ciphertext, tag,
    aad=b"associated metadata"
)
# If tampered → raises AuthenticationError

Proven at 29 tests. Ready for production.

Full algorithm suite verified: SM2 key generation, signing, and verification. SM3 hashing with known-answer tests. SM4-GCM encryption/decryption and authentication tag validation. 29 tests. 29 passes. Ready for deployment.

Technical Specifications

SM2
256-bit ECC, digital signatures and key exchange, GB/T 32918
SM3
256-bit cryptographic hash, known-answer tested
SM4-GCM
128-bit block cipher, Galois/Counter Mode AEAD
Compliance
GB/T 32918-1 through 32918-5
Tests
29 known-answer and KAT tests, 100% pass
Implementation
Pure Python, zero native dependencies, fully auditable