CryptoHives .NET Foundation
Welcome to the CryptoHives .NET Foundation documentation.
Overview
CryptoHives .NET Foundation is a set of libraries for .NET applications, covering high-performance memory management, async threading primitives, and cryptographic algorithms.
Ecosystem
The initiative currently includes three packages:
- Threading — async synchronization primitives built for low/no allocation and high throughput, using
ValueTask-based waiters backed by pooled resources - Memory — buffer management on top of
ArrayPool<T>and the modern .NET memory APIs, for transformation pipelines and crypto workloads that work in terms ofReadOnlySpanorIBufferWriter - Cryptography — OS-independent reimplementations of
System.Security.Cryptographyalgorithms, usable as drop-in replacements
Available Packages
Memory Package
Buffer management utilities that lean on ArrayPool<T> and modern .NET memory APIs to keep GC pressure out of transformation pipelines and cryptographic workloads.
Key features:
ArrayPoolMemoryStreamandArrayPoolBufferWriter<T>, both backed byArrayPool<byte>.Shared- Lifetime-managed
ReadOnlySequence<byte>support over pooled storage ReadOnlySequenceMemoryStreamfor streaming from an existingReadOnlySequence<byte>ObjectPool-backed resource management helpers, e.g. forStringBuilder
Threading Package
Async synchronization primitives built for low allocation and high throughput.
Key features:
- All waiters are
ValueTask-based synchronization primitives, designed around low memory allocation - An optional Roslyn analyzer package that catches common
ValueTaskmisuse at compile time - Full
CancellationTokensupport across every wait/lock primitive IValueTaskSource<T>-based implementations backed byObjectPool<T>, so waiter objects get recycled instead of allocatedAsyncLockfor async mutual exclusion, with scoped locking via theIDisposablepatternAsyncAutoResetEventandAsyncManualResetEvent, complementing the existingTask-based equivalentsAsyncBarrieras an async-aware replacement for the .NET barrier- Pooled
AsyncReaderWriterLock,AsyncSemaphore, andAsyncCountdownEvent, all with async wait support - Fast-path optimizations for the uncontended case
- No-allocation design for hot-path code and cancellation tokens (see Benchmarks)
Explore the Threading package →
Security.Cryptography Package
Specification-based implementations of hash algorithms, MACs, ciphers, and key derivation functions, all fully managed and OS-independent.
Key features:
- SHA-1, SHA-2, SHA-3 families, all validated against full test vectors
- SHAKE and cSHAKE extendable-output functions (XOF) for variable-length output
- TurboSHAKE and KangarooTwelve (KT128/KT256), the high-performance XOFs
- KMAC (Keccak Message Authentication Code) for authenticated hashing
- Ascon lightweight hashing and AEAD (NIST SP 800-232) for constrained environments
- BLAKE2b, BLAKE2s, and BLAKE3, with keyed modes
- Keccak-256/384/512 for Ethereum compatibility
- Regional standards: SM3 (China), Streebog/GOST (Russia), Kupyna/DSTU (Ukraine), LSH/KS (Korea), Whirlpool (ISO)
- Legacy algorithms MD5, SHA-1, RIPEMD-160, kept for compatibility only
- AES-CBC, AES-GCM, AES-CCM, ChaCha20, ChaCha20-Poly1305, XChaCha20-Poly1305, and Ascon-AEAD128 ciphers
- Regional block ciphers: SM4, ARIA, Camellia, Kuznyechik, Kalyna, SEED
- Key derivation: HKDF, KBKDF, Concat KDF, PBKDF2, BLAKE3 DeriveKey
- MACs: HMAC, AES-CMAC, AES-GMAC, Poly1305, KMAC, BLAKE2/3 keyed
- AES Key Wrap with Padding (RFC 3394/5649)
- Cross-platform consistency with no dependency on OS crypto APIs
Explore the Security.Cryptography package →
Platform Support
- .NET 10.0
- .NET 8.0
- .NET Framework 4.6.2
- .NET Standard 2.1
- .NET Standard 2.0
Resources
License
This project is licensed under the MIT License. See the LICENSE file for details.
© 2026 The Keepers of the CryptoHives