Refine ss_align interfaces

This commit is contained in:
Max Lv
2019-01-22 12:59:29 +08:00
parent fbb311ed06
commit 782311ad2b
7 changed files with 21 additions and 13 deletions
+2 -2
View File
@@ -331,7 +331,7 @@ aead_cipher_ctx_init(cipher_ctx_t *cipher_ctx, int method, int enc)
const cipher_kt_t *cipher = aead_get_cipher_type(method);
if (method == AES256GCM && crypto_aead_aes256gcm_is_available()) {
cipher_ctx->aes256gcm_ctx = ss_align(sizeof(aes256gcm_ctx));
cipher_ctx->aes256gcm_ctx = ss_aligned_malloc(sizeof(aes256gcm_ctx));
memset(cipher_ctx->aes256gcm_ctx, 0, sizeof(aes256gcm_ctx));
} else {
cipher_ctx->aes256gcm_ctx = NULL;
@@ -382,7 +382,7 @@ aead_ctx_release(cipher_ctx_t *cipher_ctx)
}
if (cipher_ctx->aes256gcm_ctx != NULL) {
ss_free(cipher_ctx->aes256gcm_ctx);
ss_aligned_free(cipher_ctx->aes256gcm_ctx);
return;
}