Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
745 changes: 745 additions & 0 deletions .plans/openssl-encrypt-decrypt.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to elephc, a PHP-to-native compiler written in Rust.
Releases are listed newest first.

## [Unreleased]
- Added OpenSSL-compatible symmetric encryption across compiled and `eval()` code with `openssl_encrypt()`, `openssl_decrypt()`, `openssl_cipher_iv_length()`, and `openssl_get_cipher_methods()`: a pure-Rust, pay-for-use crypto bridge implements AES-128/192/256 CBC, CTR, ECB, and GCM; supports raw/Base64 data, PHP key and IV normalization, zero-padding flags, GCM AAD and 1–16 byte by-reference tags; and requires no system OpenSSL dependency on any supported target.
- Added PHP-compatible `parse_url()` to native compilation and the Magician `eval()` runtime, including associative and component-selector return shapes, `PHP_URL_*` constants, IPv6/userinfo/port edge cases, catchable invalid-selector `ValueError`s, and identical support on macOS ARM64, Linux ARM64, and Linux x86_64.
- Expanded PDO to an eleven-driver compatibility matrix: SQLite, PostgreSQL, and MySQL/MariaDB remain enabled by default, while optional DBLIB, Firebird, ODBC, Informix, IBM, SQLSRV, OCI, and CUBRID profiles add PHP 8.0–8.6 driver surfaces and live-database qualification with explicit external client requirements.
- Fixed by-reference `foreach` over indexed and associative array elements silently discarding mutations or stopping early when the parent was replaced (issue #580).
Expand Down
78 changes: 77 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion crates/elephc-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "elephc-crypto"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "Pure-Rust hashing/HMAC bridge staticlib (RustCrypto) for the elephc PHP-to-native compiler's hash() family"
description = "Pure-Rust hashing, HMAC, and symmetric-cipher bridge for the elephc PHP-to-native compiler"
publish = false

# Built as a C-callable staticlib (linked into compiled PHP programs that use
Expand Down Expand Up @@ -32,3 +32,14 @@ whirlpool = "0.10"
crc32fast = "1"
crc = "3"
adler2 = "2"

# Symmetric crypto for the openssl_encrypt()/openssl_decrypt() surface. AES,
# block/stream traits, CTR, and GHASH are all pure-Rust and musl-friendly. GCM
# is composed from AES + GHASH here because PHP accepts runtime-variable nonce
# lengths and 1..=16-byte tags, while the high-level RustCrypto aes-gcm type
# encodes both sizes at compile time.
aes = "0.8"
cipher = "0.4"
ctr = "0.9"
ghash = "0.5"
subtle = "2"
Loading
Loading