Table of Contents

Enum CryptoHelper.NonceSide

Namespace
FishMMO.Auth.Implementation
Assembly
FishMMO-AuthShared.dll

Disposable container that owns a GCM session prefix and provides thread-safe nonce generation. Zeroes the prefix on dispose to prevent accidental reuse across sessions.

public enum CryptoHelper.NonceSide : byte

Fields

ClientToServer = 0

Client→server direction (nonce direction byte = 0x00).

ServerToClient = 1

Server→client direction (nonce direction byte = 0x01).

Remarks

Session isolation: Each CryptoHelper.GcmNonceContext copies the prefix at construction time. Disposing the context zeroes the copy, making it impossible to generate new nonces with the old prefix. This structurally prevents the catastrophic nonce-reuse scenario where a stale prefix from a previous session is accidentally used with a new counter.

Thread safety: Counter increments use Increment(ref long). Multiple threads may call NextNonce concurrently.