Browse Source

Fix: multiple definition of 'polyHashADInternal'
- both stock golang tls and the Psiphon fork include
chacha20poly1305_amd64.s, which defines this global
symbol.

Rod Hynes 9 years ago
parent
commit
c36ea33b54

+ 9 - 9
psiphon/common/tls/crypto/chacha20poly1305/chacha20poly1305_amd64.s

@@ -209,7 +209,7 @@ GLOBL ·andMask<>(SB), (NOPTR+RODATA), $240
 #define polyMul polyMulStage1; polyMulStage2; polyMulStage3; polyMulReduceStage
 #define polyMulAVX2 polyMulStage1_AVX2; polyMulStage2_AVX2; polyMulStage3_AVX2; polyMulReduceStage
 // ----------------------------------------------------------------------------
-TEXT polyHashADInternal<>(SB), NOSPLIT, $0
+TEXT polyHashADInternalPsiphon<>(SB), NOSPLIT, $0
 	// adp points to beginning of additional data
 	// itr2 holds ad length
 	XORQ acc0, acc0
@@ -322,7 +322,7 @@ openSSEPreparePolyKey:
 
 	// Hash AAD
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 
 openSSEMainLoop:
 	CMPQ inl, $256
@@ -483,7 +483,7 @@ openSSE128InnerCipherLoop:
 
 	// Hash
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 
 openSSE128Open:
 	CMPQ inl, $16
@@ -829,7 +829,7 @@ openAVX2PreparePolyKey:
 
 	// Hash AD + first 64 bytes
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 	XORQ itr1, itr1
 
 openAVX2InitialHash64:
@@ -1021,7 +1021,7 @@ openAVX2192InnerCipherLoop:
 openAVX2ShortOpen:
 	// Hash
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 
 openAVX2ShortOpenLoop:
 	CMPQ inl, $32
@@ -1561,7 +1561,7 @@ sealSSEIntroLoop:
 
 	// Hash AAD
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 
 	MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0
 	PXOR  A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1
@@ -1866,7 +1866,7 @@ sealSSE128InnerCipherLoop:
 
 	// Hash
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 	XORQ itr1, itr1
 
 sealSSE128SealHash:
@@ -2041,7 +2041,7 @@ sealAVX2IntroLoop:
 
 	// Hash AD
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 
 	// Can store at least 320 bytes
 	VPXOR   (0*32)(inp), AA0, AA0
@@ -2304,7 +2304,7 @@ sealAVX2192InnerCipherLoop:
 sealAVX2ShortSeal:
 	// Hash aad
 	MOVQ ad_len+80(FP), itr2
-	CALL polyHashADInternal<>(SB)
+	CALL polyHashADInternalPsiphon<>(SB)
 	XORQ itr1, itr1
 
 sealAVX2SealHash: