Abstract
In quantum cryptography, secure randomness expansion involves using a short private string of random bits to generate a longer one, even in the presence of an adversary who may have access to quantum resources. In this work, we demonstrate that local contextuality-based self-tests are sufficient to construct a randomness expansion protocol that is secure against computationally unbounded quantum adversaries. Our protocol is based on self-testing from non-contextuality inequalities and we prove that our scheme asymptotically produces secure random numbers which are O(m√ε)-close to uniformly distributed and private, where ε is the robustness parameter of the self-test and m is the length of the generated random bit string. Our protocol is semi-device-independent in the sense that it inherits any assumptions necessary for the underlying self-test.