Implicit Computational Complexity of Subrecursive Definitions and Applications to Cryptographic Proofs