mirror of
				https://git.proxmox.com/git/libgit2
				synced 2025-11-04 10:07:47 +00:00 
			
		
		
		
	Add a 'git__' prefix to the block-sha1 functions
This reduces the global namespace pollution. These functions were the only remaining external symbols (with the exception of an PPC_SHA1 build) which did not start with 'git', and since these are private library symbols the 'git__' prefix is appropriate. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
This commit is contained in:
		
							parent
							
								
									d03f567593
								
							
						
					
					
						commit
						4386ee2acb
					
				@ -221,7 +221,7 @@ static void blk_SHA1_Block(blk_SHA_CTX *ctx, const unsigned int *data)
 | 
			
		||||
	ctx->H[4] += E;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void blk_SHA1_Init(blk_SHA_CTX *ctx)
 | 
			
		||||
void git__blk_SHA1_Init(blk_SHA_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	ctx->size = 0;
 | 
			
		||||
 | 
			
		||||
@ -233,7 +233,7 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx)
 | 
			
		||||
	ctx->H[4] = 0xc3d2e1f0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
 | 
			
		||||
void git__blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
 | 
			
		||||
{
 | 
			
		||||
	unsigned int lenW = ctx->size & 63;
 | 
			
		||||
 | 
			
		||||
@ -261,7 +261,7 @@ void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
 | 
			
		||||
		memcpy(ctx->W, data, len);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
 | 
			
		||||
void git__blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	static const unsigned char pad[64] = { 0x80 };
 | 
			
		||||
	unsigned int padlen[2];
 | 
			
		||||
@ -272,8 +272,8 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
 | 
			
		||||
	padlen[1] = htonl((uint32_t)(ctx->size << 3));
 | 
			
		||||
 | 
			
		||||
	i = ctx->size & 63;
 | 
			
		||||
	blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));
 | 
			
		||||
	blk_SHA1_Update(ctx, padlen, 8);
 | 
			
		||||
	git__blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));
 | 
			
		||||
	git__blk_SHA1_Update(ctx, padlen, 8);
 | 
			
		||||
 | 
			
		||||
	/* Output hash */
 | 
			
		||||
	for (i = 0; i < 5; i++)
 | 
			
		||||
 | 
			
		||||
@ -12,11 +12,11 @@ typedef struct {
 | 
			
		||||
	unsigned int W[16];
 | 
			
		||||
} blk_SHA_CTX;
 | 
			
		||||
 | 
			
		||||
void blk_SHA1_Init(blk_SHA_CTX *ctx);
 | 
			
		||||
void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
 | 
			
		||||
void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
 | 
			
		||||
void git__blk_SHA1_Init(blk_SHA_CTX *ctx);
 | 
			
		||||
void git__blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
 | 
			
		||||
void git__blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
#define SHA_CTX		blk_SHA_CTX
 | 
			
		||||
#define SHA1_Init	blk_SHA1_Init
 | 
			
		||||
#define SHA1_Update	blk_SHA1_Update
 | 
			
		||||
#define SHA1_Final	blk_SHA1_Final
 | 
			
		||||
#define SHA1_Init	git__blk_SHA1_Init
 | 
			
		||||
#define SHA1_Update	git__blk_SHA1_Update
 | 
			
		||||
#define SHA1_Final	git__blk_SHA1_Final
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user