From 131b7c2bcfc414066e6f20304f338d117eb0ea4c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 13 Jun 2023 18:10:18 -0500 Subject: [PATCH] wolfcrypt/src/chacha20_poly1305.c: refactor ssize_t uses in wc_XChaCha20Poly1305_crypt_oneshot() as long int, for portability. --- wolfcrypt/src/chacha20_poly1305.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index e4ebd1016..0c37de747 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -355,9 +355,9 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot( int isEncrypt) { int ret; - ssize_t dst_len = isEncrypt ? - (ssize_t)src_len + POLY1305_DIGEST_SIZE : - (ssize_t)src_len - POLY1305_DIGEST_SIZE; + long int dst_len = isEncrypt ? + (long int)src_len + POLY1305_DIGEST_SIZE : + (long int)src_len - POLY1305_DIGEST_SIZE; const byte *src_i; byte *dst_i; size_t src_len_rem; @@ -375,7 +375,7 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot( goto out; } - if ((ssize_t)dst_space < dst_len) { + if ((long int)dst_space < dst_len) { ret = BUFFER_E; goto out; }