  We analyse the onset temperature T_p for the pairing in cuprate
superconductors at small doping, when tendency towards antiferromagnetism is
strong. We consider the model of Moon and Sachdev (MS), which assumes that
electron and hole pockets survive in a paramagnetic phase. Within this model,
the pairing between fermions is mediated by a gauge boson, whose propagator
remains massless in a paramagnet. We relate the MS model to a generic
\gamma-model of quantum-critical pairing with the pairing kernel \lambda
(\Omega) \propto 1/\Omega^{\gamma}. We show that, over some range of
parameters, the MS model is equivalent to the \gamma-model with \gamma =1/3
(\lambda (\Omega) \propto \Omega^{-1/3}). We find, however, that the parameter
range where this analogy works is bounded on both ends. At larger deviations
from a magnetic phase, the MS model becomes equivalent to the \gamma-model with
varying \gamma >1/3, whose value depends on the distance to a magnetic
transition and approaches \gamma =1 deep in a paramagnetic phase. Very near the
transition, the MS model becomes equivalent to the \gamma-model with varying
\gamma <1/3. Right at the magnetic QCP, the MS model is equivalent to the
\gamma-model with \gamma =0+ (\lambda (\Omega) \propto \log \Omega), which is
the model for color superconductivity. Using this analogy, we verified the
formula for T_c derived for color superconductivity.
