-void CryptState_genKey(cryptState_t *cs) {
- RAND_bytes(cs->raw_key, AES_BLOCK_SIZE);
- RAND_bytes(cs->encrypt_iv, AES_BLOCK_SIZE);
- RAND_bytes(cs->decrypt_iv, AES_BLOCK_SIZE);
- AES_set_encrypt_key(cs->raw_key, 128, &cs->encrypt_key);
- AES_set_decrypt_key(cs->raw_key, 128, &cs->decrypt_key);
+void CryptState_genKey(cryptState_t *cs)
+{
+ CRYPT_RANDOM_BYTES(&cs->raw_key, AES_BLOCK_SIZE);
+ CRYPT_RANDOM_BYTES(&cs->encrypt_iv, AES_BLOCK_SIZE);
+ CRYPT_RANDOM_BYTES(&cs->decrypt_iv, AES_BLOCK_SIZE);
+
+ CRYPT_SET_ENC_KEY(&cs->encrypt_key, cs->raw_key, 128);
+ CRYPT_SET_DEC_KEY(&cs->decrypt_key, cs->raw_key, 128);
+