Update public source

This commit is contained in:
2026-10-13 09:36:04 +03:00
parent 4876d2de9c
commit 4aa23c206f
4 changed files with 357 additions and 0 deletions
@@ -0,0 +1,30 @@
CREATE TABLE IF NOT EXISTS crack_search_contexts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
token_hash TEXT NOT NULL UNIQUE,
criteria_json TEXT NOT NULL,
matched_access_point_count INTEGER NOT NULL,
handshake_count INTEGER NOT NULL,
created_at TEXT NOT NULL,
expires_at TEXT NOT NULL,
CHECK (matched_access_point_count >= 0),
CHECK (handshake_count >= 0),
CHECK (expires_at > created_at)
);
CREATE TABLE IF NOT EXISTS crack_search_context_handshakes (
token_hash TEXT NOT NULL,
handshake_id INTEGER NOT NULL,
PRIMARY KEY (token_hash, handshake_id),
FOREIGN KEY (token_hash)
REFERENCES crack_search_contexts(token_hash)
ON DELETE CASCADE,
FOREIGN KEY (handshake_id)
REFERENCES handshakes(id)
ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_crack_search_contexts_expires
ON crack_search_contexts(expires_at);
CREATE INDEX IF NOT EXISTS idx_crack_search_context_handshakes_handshake
ON crack_search_context_handshakes(handshake_id);