  A device-independent randomness expansion protocol aims to take an initial
random seed and generate a longer one without relying on details of how the
devices operate for security. A large amount of work to date has focussed on a
particular protocol based on spot-checking devices using the CHSH inequality.
Here we show how to derive randomness expansion rates for a wide range of
protocols, with security against a quantum adversary. Our technique uses
semidefinite programming and a recent improvement of the entropy accumulation
theorem. To support the work and facilitate its use, we provide code that can
generate lower bounds on the amount of randomness that can be output based on
the measured quantities in the protocol. As an application, we give a protocol
that robustly generates up to two bits of randomness per entangled qubit pair,
which is twice that established in existing analyses of the spot-checking CHSH
protocol in the low noise regime.
