Multi-Engine SDK Guides & C99 FFI ABI Reference

Generated from the canonical agy2/cipher-jump headers (include/cipher_jump.h, include/cipher_jump.hpp, CipherJump.cs, and CipherJumpPacketHandler.h). Press Ctrl+K or / to filter docs and ABI exports instantly.

ARCHITECTURE • DIRECTIONAL THREAT MODEL

Mode A (Managed UDP Sockets) vs. Mode B (In-Memory Engine Pipeline)

CipherJump exposes two complementary integration surfaces from the same Rust core library (cipher_jump_core.dll on Windows x64, libcipher_jump_core.so on Linux x86_64):

  • Mode B — In-Memory Session Pipeline (Recommended for Game Engines): CipherJumpClientSession and CipherJumpServerSession operate directly on caller-owned memory buffers with zero internal sockets and zero heap allocations on hot game ticks. Game engines (Unreal Engine UNetConnection / PacketHandler, Unity / Godot custom transports, C++20 dedicated servers) pass outbound payload and cleartext attestation bytes into cipher_jump_client_session_encrypt and pass raw incoming UDP datagrams into cipher_jump_server_session_decrypt.
  • Mode A — Standalone Managed UDP Transport: CipherJumpHandle and CipherJumpServerHandle bind and manage OS UDP sockets directly for standalone tools, custom daemons, and simulation harnesses.
Directional Security Architecture: CipherJump is engineered to protect authoritative game state and client telemetry by cryptographically securing the Client → Server datagram pipeline against tampering, forging, and replay attacks. Server → Client broadcast and replication traffic is unencrypted (plaintext) by design in v0.3.0; studios requiring Server → Client confidentiality should pair CipherJump with DTLS or engine-level broadcast encryption.
UNREAL ENGINE 5.8.3 VERIFIED • MODE B HANDLER

Unreal Engine 5 Integration (FCipherJumpPacketHandler)

The Unreal Engine plugin (plugins/UnrealEngine/CipherJump/CipherJump.uplugin) pins "EngineVersion": "5.8.0" and has been compiled and verified against Unreal Engine 5.8.3 (earlier UE 5.x releases are target-compatible). It implements Unreal's HandlerComponent interface to intercept bitstreams between UNetConnection and the raw UDP socket.

1. Module & Project Configuration

Copy Plugins/CipherJump into your Unreal project's Plugins/ folder, add "CipherJump" to your target's PublicDependencyModuleNames, and add the project configuration block below to your game's Config/DefaultEngine.ini:

; Config/DefaultEngine.ini (Project configuration consuming the CipherJump module)
[PacketHandlerComponents]
+Components=CipherJump.CipherJumpPacketHandler

2. Per-Connection Session Initialization & Advisory 1200B MTU Check

  • Per-Connection Replay Isolation: On dedicated servers, each UNetConnection instantiates its own FCipherJumpPacketHandler (or calls SetClientId(uint64) when multiplexing) so replay tracking is isolated per 64-bit client connection ID.
  • Automatic Seed Zeroization: Calling ConfigureSession(...) initializes the underlying cipherjump::ClientSession / ServerSession and immediately wipes the temporary WOD buffer via FMemory::Memzero.
  • Advisory / Warn-Only 1200B MTU Check: FCipherJumpPacketHandler::MaxUdpMtuBytes = 1200 (`FixedCryptoOverheadBytes = 44`) is strictly advisory (warn-only via UE_LOG) in CipherJumpPacketHandler.cpp:188-194 so oversized initial handshake packets are never truncated or dropped.
#include "CipherJumpPacketHandler.h"

void UMyNetDriverSubsystem::BindMatchTicketToConnection(
    FCipherJumpPacketHandler& Handler,
    TArrayView<const uint8> MatchWodSeed, // 32 bytes from TLS join ticket
    uint16 NetId,
    uint64 ServerEpochOffset,
    uint64 ClientConnectionId)
{
    Handler.SetClientId(ClientConnectionId);
    Handler.ConfigureSession(MatchWodSeed, NetId, ServerEpochOffset, /*EpochDurationMs=*/250, /*WindowSize=*/3);
}

// On client disconnect, evict replay state from the server session:
void UMyNetDriverSubsystem::OnClientDisconnected(FCipherJumpPacketHandler& Handler)
{
    Handler.NotifyConnectionLost();
}
.NET & C# SDK • VERIFIED: netstandard2.1 / net8.0 / net9.0

.NET / C# Span<byte> SDK (Target Engines: Unity & Godot 4)

bindings/csharp/CipherJump/CipherJump.cs targets netstandard2.1, net8.0, and net9.0 for drop-in compatibility with Unity (via UPM package com.failsafestudio.cipherjump or CipherJump-Unity-v0.3.0.unitypackage) and Godot 4 C#. Native handle lifecycles are managed via SafeHandleZeroOrMinusOneIsInvalid (`SafeClientSessionHandle` and `SafeServerSessionHandle`).

using System;
using CipherJump;

// 1. Client-side zero-allocation encryption:
using var clientSession = CipherJumpClientSession.Create(
    wodSeed: joinTicketWod,   // ReadOnlySpan<byte> (32 bytes)
    netId: 1,
    epochOffset: 1000,
    epochDurationMs: 250,
    windowSize: 3);

Span<byte> wireBuf = stackalloc byte[
    CipherJumpSecurity.HeaderFixedSize + attestSpan.Length + payloadSpan.Length + CipherJumpSecurity.GcmTagSize];
int wireLen = clientSession.Encrypt(payloadSpan, attestSpan, wireBuf);

// 2. Dedicated Server zero-allocation decryption & AAD verification:
using var serverSession = CipherJumpServerSession.Create(joinTicketWod, netId: 1, epochOffset: 1000);
Span<byte> outPayload = stackalloc byte[1024];
Span<byte> outAttest  = stackalloc byte[128];

var result = serverSession.Decrypt(
    clientId: peerConnectionId,
    inWire: wireBuf.Slice(0, wireLen),
    outPayload: outPayload,
    outAttestation: outAttest);

// Disconnect cleanup:
serverSession.RemoveClient(peerConnectionId);
C++20 HEADER-ONLY • 100% noexcept HOT PATHS

C++20 Exception-Free Header SDK (include/cipher_jump.hpp)

include/cipher_jump.hpp wraps the C99 ABI in move-only RAII classes (cipherjump::ClientSession, cipherjump::ServerSession, cipherjump::Client, cipherjump::Server) returning cipherjump::Result<T> value types. It compiles cleanly with exceptions disabled (verified under MSVC /std:c++20 /EHs-c- in the 4-peer, 1,000-frame @ 60 Hz simulation harness).

#include "cipher_jump.hpp"

// Generate a 32-byte WOD root seed on the match server via OS CSPRNG:
auto seedRes = cipherjump::generate_wod_seed();
if (!seedRes) return;
std::array<uint8_t, 32> wodSeed = *seedRes;

// Create move-only RAII client & server sessions:
auto clientRes = cipherjump::ClientSession::create(wodSeed, /*net_id=*/1, /*epoch_offset=*/1000);
auto serverRes = cipherjump::ServerSession::create(wodSeed, /*net_id=*/1, /*epoch_offset=*/1000);

std::array<uint8_t, 512> wireBuf{};
auto encRes = clientRes->encrypt(payloadSpan, attestSpan, wireBuf);
if (encRes.is_ok()) {
    std::span<const uint8_t> wireFrame{wireBuf.data(), *encRes};
    std::array<uint8_t, 256> decPayload{};
    std::array<uint8_t, 128> decAttest{};
    auto decRes = serverRes->decrypt(/*client_id=*/42ULL, wireFrame, decPayload, decAttest);
}
FLEET DEPLOYMENT • TLS JOIN-TICKET HANDSHAKE

Dedicated Server Fleet & Out-of-Band WOD Seed Handshake

CipherJump does not require a standalone matchmaker binary. Instead, the 32-byte match secret is generated and distributed inside your studio's existing authenticated matchmaking / join-ticket flow:

  1. Server Seed Generation: When a match instance spins up (Windows cipher_jump_core.dll or Linux x86_64 libcipher_jump_core.so), the dedicated server calls cipher_jump_generate_wod_seed(uint8_t *out_seed) to generate a 256-bit CSPRNG Word-of-Day seed and initializes cipher_jump_server_session_create.
  2. Out-of-Band TLS Join-Ticket Delivery: When a player is authorized to join the match, your matchmaking service includes the 4-tuple (wod_seed [32B], net_id [u16], epoch_offset [u64], epoch_duration_ms [250]) inside the player's TLS-encrypted join ticket.
  3. Zero-Handshake UDP Datagram Flow: The game client initializes cipher_jump_client_session_create with the join-ticket parameters and immediately wipes its copy of wod_seed. From the very first UDP packet, both peers deterministically hop keys and AEAD cipher suites every 250ms with zero UDP handshake round-trips.
C99 FFI SPECIFICATION • include/cipher_jump.h

Interactive C99 FFI ABI Explorer (17 Exports)

17 / 17 exports shown

Opaque Handle Structs & Wire Constants (include/cipher_jump.h)

/* 4 Opaque Session & Socket Handle Types */
typedef struct CipherJumpClientSession CipherJumpClientSession;
typedef struct CipherJumpServerSession CipherJumpServerSession;
typedef struct CipherJumpHandle        CipherJumpHandle;
typedef struct CipherJumpServerHandle  CipherJumpServerHandle;

/* Canonical Wire Framing & Protocol Constants */
#define HEADER_FIXED_SIZE          28  /* net_id(2)+rsvd(1)+flags(1)+epoch(8)+nonce(12)+att_len(2)+rsvd(2) */
#define GCM_TAG_SIZE               16  /* 128-bit AEAD tag appended to ciphertext (min packet = 44 bytes) */
#define NONCE_SIZE                 12  /* 96-bit AEAD IV: epoch_id_low32 (4B BE) || counter_64 (8B BE) */
#define FLAG_CHATTERMARK_MIGRATION  4  /* Bit 2 (0x04): 58-byte signed MigrationDirective packet */
#define FLAG_RESYNC                 8  /* Bit 3 (0x08): 57-byte MICKEY TOD resynchronization frame */
#define DEFAULT_WINDOW_SIZE         3  /* +/-3 epochs (+/-750ms sliding acceptance window) */
#define MIGRATION_DIRECTIVE_SIZE   58  /* new_port(2) + salt(16) + migration_epoch(8) + hmac_sig(32) */
#define RESYNC_FRAME_SIZE          57  /* frame_type(1) + challenge_nonce(16) + epoch(8) + hmac_sig(32) */

C99 Return Status & Error Code Table (12 Constants)

Note: Statistical rate-burst anomalies (Scenario 7, exceeding max(μ + 3.0σ, 10.0) packets/epoch) are surfaced asynchronously via the server's AnomalyReport callback rather than a negative FFI return code.

C Macro Constant Value Meaning & Trigger Condition