  We consider a new model for the testing of untrusted quantum devices,
consisting of a single polynomial-time bounded quantum device interacting with
a classical polynomial-time verifier. In this model we propose solutions to two
tasks - a protocol for efficient classical verification that the untrusted
device is "truly quantum," and a protocol for producing certifiable randomness
from a single untrusted quantum device. Our solution relies on the existence of
a new cryptographic primitive for constraining the power of an untrusted
quantum device: post-quantum secure trapdoor claw-free functions which must
satisfy an adaptive hardcore bit property. We show how to construct this
primitive based on the hardness of the learning with errors (LWE) problem.
