Cryptographic and average-case complexity