From 51838634b95632b7430626839f8ee7a64ab1a92e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Wed, 17 Nov 2004 22:20:36 +0100
Subject: [PATCH] * x86/sha1-compress.asm: Use C_NAME for global symbols. *
 x86/aes-encrypt.asm: Likewise. * x86/aes-decrypt.asm: Likewise. *
 x86/arcfour-crypt.asm: Likewise.

Rev: src/nettle/x86/aes-decrypt.asm:1.20
Rev: src/nettle/x86/aes-encrypt.asm:1.21
Rev: src/nettle/x86/arcfour-crypt.asm:1.12
Rev: src/nettle/x86/sha1-compress.asm:1.6
---
 x86/aes-decrypt.asm   | 20 ++++++++++----------
 x86/aes-encrypt.asm   | 22 +++++++++++-----------
 x86/arcfour-crypt.asm |  8 ++++----
 x86/sha1-compress.asm |  6 +++---
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/x86/aes-decrypt.asm b/x86/aes-decrypt.asm
index f792b247..5e5c2fcf 100644
--- a/x86/aes-decrypt.asm
+++ b/x86/aes-decrypt.asm
@@ -20,13 +20,13 @@ C MA 02111-1307, USA.
 	.file "aes-decrypt.asm"
 
 	C aes_decrypt(struct aes_context *ctx, 
-	C             unsigned length, uint8_t *dst,
-	C 	      uint8_t *src)
+	C	      unsigned length, uint8_t *dst,
+	C	      uint8_t *src)
 	.text
 	.align 16
-	.globl nettle_aes_decrypt
-	.type  nettle_aes_decrypt,@function
-nettle_aes_decrypt:
+	.globl C_NAME(nettle_aes_decrypt)
+	.type  C_NAME(nettle_aes_decrypt),@function
+C_NAME(nettle_aes_decrypt):
 	C save all registers that need to be saved
 	pushl	%ebx		C  16(%esp)
 	pushl	%ebp		C  12(%esp)
@@ -59,16 +59,16 @@ nettle_aes_decrypt:
 	C In these patterns, note that each row, like
 	C "a,d,c,b" corresponds to one *column* of the 
 	C array _aes_decrypt_table.idx.
-	AES_ROUND(_nettle_aes_decrypt_table,a,d,c,b)
+	AES_ROUND(C_NAME(_nettle_aes_decrypt_table),a,d,c,b)
 	pushl	%edi		C  save first on stack
 
-	AES_ROUND(_nettle_aes_decrypt_table,b,a,d,c)
+	AES_ROUND(C_NAME(_nettle_aes_decrypt_table),b,a,d,c)
 	pushl	%edi
 
-	AES_ROUND(_nettle_aes_decrypt_table,c,b,a,d)
+	AES_ROUND(C_NAME(_nettle_aes_decrypt_table),c,b,a,d)
 	pushl	%edi		C  save first on stack
 
-	AES_ROUND(_nettle_aes_decrypt_table,d,c,b,a)
+	AES_ROUND(C_NAME(_nettle_aes_decrypt_table),d,c,b,a)
 
 	movl	%edi,%edx
 	popl	%ecx
@@ -129,4 +129,4 @@ nettle_aes_decrypt:
 	popl	%ebx
 	ret
 .Leord:
-	.size	nettle_aes_decrypt,.Leord-nettle_aes_decrypt
+	.size	C_NAME(nettle_aes_decrypt),.Leord-C_NAME(nettle_aes_decrypt)
diff --git a/x86/aes-encrypt.asm b/x86/aes-encrypt.asm
index 19ae0526..346ddf5c 100644
--- a/x86/aes-encrypt.asm
+++ b/x86/aes-encrypt.asm
@@ -31,13 +31,13 @@ C %edi is a temporary, often used as an accumulator.
 	.file "aes-encrypt.asm"
 	
 	C aes_encrypt(struct aes_context *ctx, 
-	C             unsigned length, uint8_t *dst,
-	C 	      uint8_t *src)
+	C	      unsigned length, uint8_t *dst,
+	C	      uint8_t *src)
 	.text
 	.align 16
-	.globl nettle_aes_encrypt
-	.type  nettle_aes_encrypt,@function
-nettle_aes_encrypt:
+	.globl C_NAME(nettle_aes_encrypt)
+	.type  C_NAME(nettle_aes_encrypt),@function
+C_NAME(nettle_aes_encrypt):
 	C save all registers that need to be saved
 	pushl	%ebx		C  16(%esp)
 	pushl	%ebp		C  12(%esp)
@@ -67,16 +67,16 @@ nettle_aes_encrypt:
 .Lround_loop:
 	pushl	%esi		C  save this first: we'll clobber it later
 
-	AES_ROUND(_nettle_aes_encrypt_table,a,b,c,d)
+	AES_ROUND(C_NAME(_nettle_aes_encrypt_table),a,b,c,d)
 	pushl	%edi		C  save first on stack
 
-	AES_ROUND(_nettle_aes_encrypt_table,b,c,d,a)
+	AES_ROUND(C_NAME(_nettle_aes_encrypt_table),b,c,d,a)
 	pushl	%edi		C  save first on stack
 
-	AES_ROUND(_nettle_aes_encrypt_table,c,d,a,b)
+	AES_ROUND(C_NAME(_nettle_aes_encrypt_table),c,d,a,b)
 	pushl	%edi		C  save first on stack
 
-	AES_ROUND(_nettle_aes_encrypt_table,d,a,b,c)
+	AES_ROUND(C_NAME(_nettle_aes_encrypt_table),d,a,b,c)
 	
 	movl	%edi,%edx
 	popl	%ecx
@@ -114,7 +114,7 @@ nettle_aes_encrypt:
 	C S-box substitution
 	mov	$4,%edi
 .Lsubst:
-	AES_SUBST_BYTE(_nettle_aes_encrypt_table)
+	AES_SUBST_BYTE(C_NAME(_nettle_aes_encrypt_table))
 
 	decl	%edi
 	jnz	.Lsubst
@@ -137,4 +137,4 @@ nettle_aes_encrypt:
 	popl	%ebx
 	ret
 .Leord:
-	.size	nettle_aes_encrypt,.Leord-nettle_aes_encrypt
+	.size	C_NAME(nettle_aes_encrypt),.Leord-C_NAME(nettle_aes_encrypt)
diff --git a/x86/arcfour-crypt.asm b/x86/arcfour-crypt.asm
index ee1e23e0..7f976406 100644
--- a/x86/arcfour-crypt.asm
+++ b/x86/arcfour-crypt.asm
@@ -24,9 +24,9 @@ C MA 02111-1307, USA.
 	C               const uint8_t *src)
 	.text
 	.align 16
-	.globl nettle_arcfour_crypt
-	.type  nettle_arcfour_crypt,@function
-nettle_arcfour_crypt:
+	.globl C_NAME(nettle_arcfour_crypt)
+	.type  C_NAME(nettle_arcfour_crypt),@function
+C_NAME(nettle_arcfour_crypt):
 	C save all registers that need to be saved
 	pushl	%ebx		C  12(%esp)
 	pushl	%ebp		C  8(%esp)
@@ -91,4 +91,4 @@ C	andl	$0xff, %ebx
 	popl	%ebx
 	ret
 .Leord:
-	.size	nettle_arcfour_crypt,.Leord-nettle_arcfour_crypt
+	.size	C_NAME(nettle_arcfour_crypt),.Leord-C_NAME(nettle_arcfour_crypt)
diff --git a/x86/sha1-compress.asm b/x86/sha1-compress.asm
index b5b135cc..27a1e224 100644
--- a/x86/sha1-compress.asm
+++ b/x86/sha1-compress.asm
@@ -113,9 +113,9 @@ define(<ROUND>, <
 	
 	.text
 	.align 16
-	.globl _nettle_sha1_compress
-	.type  _nettle_sha1_compress,@function
-_nettle_sha1_compress:
+	.globl C_NAME(_nettle_sha1_compress)
+	.type  C_NAME(_nettle_sha1_compress),@function
+C_NAME(_nettle_sha1_compress):
 	C save all registers that need to be saved
 	
 	pushl	%ebx		C  20(%esp)
-- 
GitLab