diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c
index 23c7975..d015004 100644
--- a/src/openvpn/tls_crypt.c
+++ b/src/openvpn/tls_crypt.c
@@ -191,7 +191,7 @@
         int outlen = 0;
         ASSERT(cipher_ctx_update(ctx->cipher, BEND(dst), &outlen, CBPTR(src), BLEN(src)));
         ASSERT(buf_inc_len(dst, outlen));
-        ASSERT(cipher_ctx_final(ctx->cipher, BPTR(dst), &outlen));
+        ASSERT(cipher_ctx_final(ctx->cipher, BEND(dst), &outlen));
         ASSERT(buf_inc_len(dst, outlen));
     }
 
@@ -247,7 +247,7 @@
             CRYPT_ERROR("cipher update failed");
         }
         ASSERT(buf_inc_len(dst, outlen));
-        if (!cipher_ctx_final(ctx->cipher, BPTR(dst), &outlen))
+        if (!cipher_ctx_final(ctx->cipher, BEND(dst), &outlen))
         {
             CRYPT_ERROR("cipher final failed");
         }
