CryptoHives .NET Foundation
Welcome to the CryptoHives .NET Foundation documentation!
Overview
The CryptoHives .NET Foundation provides libraries for .NET applications focusing on high performance memory management, threading primitives, and cryptographic algorithms.
Available Packages
💾 Memory Package
The Memory package provides allocation-efficient buffer management utilities that leverage ArrayPool<T> and modern .NET memory APIs to minimize garbage collection pressure for transformation pipelines and cryptographic workloads.
Key Features:
ArrayPoolMemoryStreamandArrayPoolBufferWriter<T>classes backed byArrayPool<byte>.Shared- Lifetime managed
ReadOnlySequence<byte>support with pooled storage ReadOnlySequenceMemoryStreamto stream fromReadOnlySequence<byte>ObjectPoolbacked resource management helpers, e.g. forStringBuilder
🔄 Threading Package
The Threading package provides high-performance async synchronization primitives optimized for low allocation and high throughput scenarios.
Key Features:
- All waiters implemented as
ValueTask-based synchronization primitives with low memory allocation design - Built-in Roslyn analyzers to detect common
ValueTaskmisuse patterns at compile time - Full
CancellationTokensupport in all Wait/Lock primitives - Implementations use
IValueTaskSource<T>based classes backed byObjectPool<T>to avoid allocations by recycling waiter objects - Async mutual exclusion with
AsyncLockand scoped locking viaIDisposablepattern AsyncAutoResetEventandAsyncManualResetEventcomplementing existing implementations which areTaskbased- Replacement for .NET barriers with
AsyncBarriersupporting async waits - Pooled implementations of
AsyncReaderWriterLock,AsyncSemaphoreandAsyncCountdownEventwith async wait support - Fast path optimizations for uncontended scenarios
- No allocation design for hot-path code and cancellation tokens (see Benchmarks)
- Benchmarks comparing performance against existing .NET synchronization primitives and various other popular implementations
🔐 Security.Cryptography Package
The Cryptography package provides specification-based implementations of cryptographic hash algorithms, message authentication codes (MACs), and cipher/AEAD algorithms, all implemented as fully managed code without OS dependencies.
Note: This package continues to expand and already includes hash, MAC, cipher (AES, ChaCha20-family), and AEAD implementations.
Key Features:
- SHA-1, SHA-2, SHA-3 family implementations with full test vector validation
- SHAKE and cSHAKE extendable-output functions (XOF) for variable-length output
- TurboSHAKE and KangarooTwelve (KT128/KT256) high-performance XOFs
- KMAC (Keccak Message Authentication Code) for authenticated hashing
- Ascon lightweight hashing (NIST FIPS 207) for constrained environments
- BLAKE2b, BLAKE2s, and BLAKE3 high-performance hashing with keyed modes
- Keccak-256, Keccak-384, Keccak-512 for Ethereum compatibility
- International standards: SM3 (Chinese), Streebog/GOST (Russian), Kupyna/DSTU (Ukrainian), LSH/KS (Korean), Whirlpool (ISO)
- Legacy algorithms: MD5, SHA-1, RIPEMD-160 (for compatibility only)
- Aes, Aes-Gcm, Aes-Ccm and ChaCha20-Poly1305 cipher implementations.
- Cross-platform consistency without OS crypto API dependencies
Explore Security.Cryptography Package
Quick Start
Each package page includes installation, quick-start examples, and API documentation:
- Memory Package — pooled buffers and streams
- Threading Package — async synchronization primitives
- Security.Cryptography Package — hash algorithms and MACs
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