  We introduce a \emph{gain function} viewpoint of information leakage by
proposing \emph{maximal $g$-leakage}, a rich class of operationally meaningful
leakage measures that subsumes recently introduced leakage measures -- {maximal
leakage} and {maximal $\alpha$-leakage}. In maximal $g$-leakage, the gain of an
adversary in guessing an unknown random variable is measured using a {gain
function} applied to the probability of correctly guessing. In particular,
maximal $g$-leakage captures the multiplicative increase, upon observing $Y$,
in the expected gain of an adversary in guessing a randomized function of $X$,
maximized over all such randomized functions. We also consider the scenario
where an adversary can make multiple attempts to guess the randomized function
of interest. We show that maximal leakage is an upper bound on maximal
$g$-leakage under multiple guesses, for any non-negative gain function $g$. We
obtain a closed-form expression for maximal $g$-leakage under multiple guesses
for a class of concave gain functions. We also study maximal $g$-leakage
measure for a specific class of gain functions related to the $\alpha$-loss. In
particular, we first completely characterize the minimal expected $\alpha$-loss
under multiple guesses and analyze how the corresponding leakage measure is
affected with the number of guesses. Finally, we study two variants of maximal
$g$-leakage depending on the type of adversary and obtain closed-form
expressions for them, which do not depend on the particular gain function
considered as long as it satisfies some mild regularity conditions. We do this
by developing a variational characterization for the R\'{e}nyi divergence of
order infinity which naturally generalizes the definition of pointwise maximal
leakage to incorporate arbitrary gain functions.
