Criterion measurements for AES-256-GCM session encryption/decryption and login-cookie assembly. Application request cost depends on the authentication flow that calls them.
encrypt_session(user_id, key): AES-256-GCM encrypt + base64-encode the user ID. Generates a random 12-byte nonce per call using OsRng. Called on every login.
decrypt_session(token, key): base64-decode + AES-256-GCM decrypt. Called on every authenticated request. This is the most critical path in the auth stack.
make_login_cookie(user_id): full pipeline — encrypt + format the Set-Cookie header string. Represents the complete overhead of setting an auth session.
Encrypt → decrypt combined for regression comparison in the CI runner; it is not a universal per-request budget.