LaTeX macros
All pseudocode and math on this site uses custom LaTeX macros for common cryptographic notation. You can copy them below to use in your own LaTeX documents or KaTeX/MathJax configurations.
Macro reference
Caligraphic letters
Macro Renders as \calA … \calZA , B , C , … , Z
Complexity classes
Macro Renders as \classPP \classNPNP \classcoNPcoNP \classBPPBPP \classRPRP \classZPPZPP \classPSPACEPSPACE \classSZKSZK \classCZKCZK
Common algorithms
Macro Renders as \GenGen \EncEnc \DecDec \SetupSetup \QueryQuery \EvalEval \InvertInvert
Key names
Macro Renders as \sksk \pkpk \vkvk
Number sets
Macro Renders as \NNN \ZZZ \FFF \GGG
Simulators and state
Macro Renders as \SimS \stst \stAst A \stBst B \stSst S
Crypto shorthand
Macro Renders as \bits{ 0 , 1 } \neglnegl \polypoly \PPTPPT \secparλ \getsr← $ \FuncsFuncs
Advantages and games
Macro Renders as \AdvAdv \ExptExpt \GameG \indcpaIND - CPA \indccaIND - CCA \eucmaEU - CMA \sufcmaSUF - CMA
Primitives
Macro Renders as \PRFPRF \RORO \PRGPRG \PRPPRP \OTOT \SKESKE \PKEPKE