Tamper-proof and Privacy-preserving Schemes for Smart Cards