Expand description
§Core functionality for the IronShield proof-of-work system.
This module contains shared code that can be used in both the server-side (Cloudflare Workers) and client-side (WASM) implementations
Modules§
- chrono
- Chrono: Date and Time for Rust
Structs§
- Iron
Shield Challenge - Iron
Shield Challenge Response - Iron
Shield Request endpoint: The endpoint URL for the request.timestamp: The timestamp of the request in unix millis.- Iron
Shield Token - PoWConfig
- Configuration parameters for proof-of-work challenges.
- Signing
Key - ed25519 signing key which can be used to produce signatures.
Enums§
Constants§
Functions§
- concat_
struct_ base64url_ decode - Decodes a Base64 URL-safe encoded string into a concatenated string.
- concat_
struct_ base64url_ encode - Encodes a concatenated string into a Base64 URL-safe format without padding.
- create_
signing_ message - Creates a message to be signed from challenge data components
- deserialize_
32_ bytes - Custom serialization for 32-byte arrays (challenge params, public keys)
- deserialize_
signature - Custom deserialization for 64-byte arrays (Ed25519 signatures)
- execute_
proof_ of_ work - Proof-of-work function that handles both worker coordination and single-threaded fallback modes.
- find_
solution - Find a solution for the given IronShieldChallenge using optimized multithreaded computation.
- generate_
signature - Generates an Ed25519 signature for a given message using the provided signing key
- generate_
test_ keypair - Generates a new Ed25519 keypair for testing purposes
- load_
private_ key_ from_ data - Loads a private key from raw key data (for Cloudflare Workers)
- load_
private_ key_ from_ env - Loads the private key from the IRONSHIELD_PRIVATE_KEY environment variable
- load_
public_ key_ from_ data - Loads a public key from raw key data (for Cloudflare Workers)
- load_
public_ key_ from_ env - Loads the public key from the IRONSHIELD_PUBLIC_KEY environment variable
- serialize_
32_ bytes - Custom serialization for 32-byte arrays (challenge params, public keys).
- serialize_
signature - Custom serialization for 64-byte arrays (Ed25519 signatures)
- sign_
challenge - Signs a challenge using the private key from environment variables.
- validate_
challenge - Verifies a challenge and checks if it’s valid and not expired
- verify_
challenge_ signature - Verifies a challenge signature using the public key from environment variables
- verify_
challenge_ signature_ with_ key - Verifies a challenge signature using a provided public key
- verify_
ironshield_ solution - Verify that an
IronShieldChallengeResponsecontains a valid solution.