# Programming Interface: Preparing Key Schedule for Both Encryption and Decryption

Quick question (01): what is the uniform interface for a symmetric block cipher? Is it

$(f:k \to k', enc_{k'}:c \to p, dec_{k'}:p \to c)$ or $(f:k \to k_e, g:k \to k_d, enc_{k_e}:c \to p, dec_{k_d}:p \to c)$?

Most nowaday symmetric-key block cipher algorithms require only one key schedule to perform both encryption and decryption (forward and backword permutation), for the few that require two, conversion are often very efficient.

My question (02) being, is there a symmetric-key cipher where preparation of decryption key schedule from encryption key schedule (or the opposite) require non-negligible effort that could hamper the performance?

• AES uses a different key schedule for decrypt which requires more computation but allows the actual decryption to be faster than it would be if it used the encrypt round keys – Richie Frame Jan 31 '18 at 3:27
• @RichieFrame I wouldn't quite agree. AES InvCipher could just use the encryption key schedule in the opposite direction at different steps in the process. – DannyNiu Jan 31 '18 at 3:29