灵符lingfu

ling-lang

↓ 0 downloads

Ling - The Omniglot Systems Language

Keywords systems, polyglot, ai, crypto, game
lingfu install ling-lang
LicenseApache-2.0 OR MIT
AuthorsLing Lin, Sanny Lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (995)

crates/ling-crypto/Cargo.toml
[package]
name = "ling-crypto"
version = "2030.1.13"
edition = "2021"
authors = ["Ling Lin <taellinglin@gmail.com>", "Sanny Lin <SannyLing53@gmail.com>"]
description = "Post-quantum and classical cryptography for Ling — real ML-KEM-768 (FIPS 203), X25519+ML-KEM hybrid KEM, AES-GCM, XChaCha20, Blake3, SHA3, Argon2id, Shamir over GF(2^8), Ristretto Schnorr ZKP, VRF. no_std-capable (std on by default) so the same crate links into the LingOS kernel."
license = "Apache-2.0 OR MIT"
readme = "README.md"
repository = "https://github.com/taellinglin/ling"

[features]
# `std` (default) = OS CSPRNG entropy + Argon2 PHC password strings.
# Turn it off (`--no-default-features --features alloc`) for a no_std target
# such as the LingOS kernel; then supply entropy via `rng::set_entropy_source`.
default = ["std"]
# The dalek crates have no `std` feature (they are always no_std + alloc); their
# `alloc`/`precomputed-tables` are enabled unconditionally below. `std` here only
# turns on the OS entropy default, Argon2 PHC strings, and SIMD Blake3.
std = [
    "alloc",
    "dep:rand",
    "argon2/std",
    "argon2/password-hash",
    "blake3/std",
]
# no_std + heap. All algorithms are present; only the OS-entropy default and the
# Argon2 PHC (`hash_password`/`verify_password`) string helpers are std-gated.
alloc = []

[dependencies]
# Core
zeroize  = { version = "1.8", default-features = false, features = ["derive", "alloc"] }
subtle   = { version = "2.6", default-features = false }

# Hashing
blake3          = { version = "1.5", default-features = false }
sha3            = { version = "0.10", default-features = false, features = ["zeroize"] }   # zeroize: XOF state that absorbed lw secrets is wiped on drop

# Symmetric AEAD — `alloc` gives the Vec-returning encrypt/decrypt; key/nonce
# come from `rng` (no getrandom).
aes-gcm          = { version = "0.10", default-features = false, features = ["aes", "alloc"] }
chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] }

# Asymmetric / ECDH / EdDSA — keys built from `rng` seeds (no rand_core methods).
# `alloc` + `precomputed-tables` are no_std-safe and enabled everywhere.
ed25519-dalek    = { version = "2.1", default-features = false, features = ["alloc"] }
x25519-dalek     = { version = "2.0", default-features = false, features = ["static_secrets", "alloc", "precomputed-tables", "zeroize"] }   # zeroize: StaticSecret wipes itself on drop (lw KEM keys)
curve25519-dalek = { version = "4.1", default-features = false, features = ["alloc", "precomputed-tables"] }

# Key derivation
argon2  = { version = "0.5", default-features = false, features = ["alloc"] }
hkdf    = { version = "0.12", default-features = false }

# Post-quantum (pure Rust). No getrandom: keygen/encaps go through the public
# deterministic/seed APIs (`from_seed`, `encapsulate_deterministic`) fed by `rng`.
ml-kem  = { version = "0.3", default-features = false, features = ["alloc", "zeroize"] } # FIPS 203 ML-KEM (zeroize: decapsulation keys wipe on drop)
ml-dsa  = { version = "0.1", default-features = false, features = ["alloc", "zeroize"] } # FIPS 204 ML-DSA (zeroize: signing keys wipe on drop)

# Floating-point transcendentals for geo.rs, portable across std and no_std.
libm    = { version = "0.2", default-features = false }

# std-only OS entropy source for the default `rng` backend.
rand    = { version = "0.8", features = ["std"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
# Browser-compatible entropy for wasm32 std builds.
getrandom = { version = "0.2", features = ["js"] }
getrandom_04 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }

[lib]
name = "ling_crypto"
path = "src/lib.rs"

← Back to index