Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2015 23:37:16 +0000 (UTC)
From:      John-Mark Gurney <jmg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286049 - head/sys/crypto/aesni
Message-ID:  <201507292337.t6TNbGPN001744@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmg
Date: Wed Jul 29 23:37:15 2015
New Revision: 286049
URL: https://svnweb.freebsd.org/changeset/base/286049

Log:
  const'ify an arg that we don't update...

Modified:
  head/sys/crypto/aesni/aesni.h
  head/sys/crypto/aesni/aesni_ghash.c

Modified: head/sys/crypto/aesni/aesni.h
==============================================================================
--- head/sys/crypto/aesni/aesni.h	Wed Jul 29 23:34:38 2015	(r286048)
+++ head/sys/crypto/aesni/aesni.h	Wed Jul 29 23:37:15 2015	(r286049)
@@ -104,7 +104,7 @@ void AES_GCM_encrypt(const unsigned char
     const unsigned char *key, int nr);
 int AES_GCM_decrypt(const unsigned char *in, unsigned char *out,
     const unsigned char *addt, const unsigned char *ivec,
-    unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes,
+    const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes,
     const unsigned char *key, int nr);
 
 int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key,

Modified: head/sys/crypto/aesni/aesni_ghash.c
==============================================================================
--- head/sys/crypto/aesni/aesni_ghash.c	Wed Jul 29 23:34:38 2015	(r286048)
+++ head/sys/crypto/aesni/aesni_ghash.c	Wed Jul 29 23:37:15 2015	(r286049)
@@ -528,7 +528,7 @@ AES_GCM_encrypt(const unsigned char *in,
 int
 AES_GCM_decrypt(const unsigned char *in, unsigned char *out,
 	const unsigned char *addt, const unsigned char *ivec,
-	unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes,
+	const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes,
 	const unsigned char *key, int nr)
 {
 	int i, j ,k;
@@ -677,7 +677,7 @@ AES_GCM_decrypt(const unsigned char *in,
 	X = _mm_shuffle_epi8(X, BSWAP_MASK);
 	T = _mm_xor_si128(X, T);
 
-	if (!m128icmp(T, _mm_loadu_si128((__m128i*)tag)))
+	if (!m128icmp(T, _mm_loadu_si128((const __m128i*)tag)))
 		return 0; //in case the authentication failed
 
 	ctr1 = _mm_shuffle_epi8(Y, BSWAP_EPI64);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507292337.t6TNbGPN001744>