1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add XXX_PROCESS_ALT mecchanism

This commit is contained in:
Manuel Pégourié-Gonnard
2015-03-31 18:32:50 +02:00
parent 26c9f90cae
commit 427b672551
9 changed files with 52 additions and 4 deletions

View File

@ -112,6 +112,7 @@ void md2_starts( md2_context *ctx )
ctx->left = 0;
}
#if !defined(POLARSSL_MD2_PROCESS_ALT)
void md2_process( md2_context *ctx )
{
int i, j;
@ -145,6 +146,7 @@ void md2_process( md2_context *ctx )
t = ctx->cksum[i];
}
}
#endif /* !POLARSSL_MD2_PROCESS_ALT */
/*
* MD2 process buffer

View File

@ -108,6 +108,7 @@ void md4_starts( md4_context *ctx )
ctx->state[3] = 0x10325476;
}
#if !defined(POLARSSL_MD4_PROCESS_ALT)
void md4_process( md4_context *ctx, const unsigned char data[64] )
{
uint32_t X[16], A, B, C, D;
@ -210,6 +211,7 @@ void md4_process( md4_context *ctx, const unsigned char data[64] )
ctx->state[2] += C;
ctx->state[3] += D;
}
#endif /* !POLARSSL_MD4_PROCESS_ALT */
/*
* MD4 process buffer

View File

@ -107,6 +107,7 @@ void md5_starts( md5_context *ctx )
ctx->state[3] = 0x10325476;
}
#if !defined(POLARSSL_MD5_PROCESS_ALT)
void md5_process( md5_context *ctx, const unsigned char data[64] )
{
uint32_t X[16], A, B, C, D;
@ -229,6 +230,7 @@ void md5_process( md5_context *ctx, const unsigned char data[64] )
ctx->state[2] += C;
ctx->state[3] += D;
}
#endif /* !POLARSSL_MD5_PROCESS_ALT */
/*
* MD5 process buffer

View File

@ -107,6 +107,7 @@ void ripemd160_starts( ripemd160_context *ctx )
ctx->state[4] = 0xC3D2E1F0;
}
#if !defined(POLARSSL_RIPEMD160_PROCESS_ALT)
/*
* Process one block
*/
@ -286,6 +287,7 @@ void ripemd160_process( ripemd160_context *ctx, const unsigned char data[64] )
ctx->state[4] = ctx->state[0] + B + Cp;
ctx->state[0] = C;
}
#endif /* !POLARSSL_RIPEMD160_PROCESS_ALT */
/*
* RIPEMD-160 process buffer

View File

@ -108,6 +108,7 @@ void sha1_starts( sha1_context *ctx )
ctx->state[4] = 0xC3D2E1F0;
}
#if !defined(POLARSSL_SHA1_PROCESS_ALT)
void sha1_process( sha1_context *ctx, const unsigned char data[64] )
{
uint32_t temp, W[16], A, B, C, D, E;
@ -263,6 +264,7 @@ void sha1_process( sha1_context *ctx, const unsigned char data[64] )
ctx->state[3] += D;
ctx->state[4] += E;
}
#endif /* !POLARSSL_SHA1_PROCESS_ALT */
/*
* SHA-1 process buffer

View File

@ -129,6 +129,7 @@ void sha256_starts( sha256_context *ctx, int is224 )
ctx->is224 = is224;
}
#if !defined(POLARSSL_SHA256_PROCESS_ALT)
void sha256_process( sha256_context *ctx, const unsigned char data[64] )
{
uint32_t temp1, temp2, W[64];
@ -259,6 +260,7 @@ void sha256_process( sha256_context *ctx, const unsigned char data[64] )
ctx->state[6] += G;
ctx->state[7] += H;
}
#endif /* !POLARSSL_SHA256_PROCESS_ALT */
/*
* SHA-256 process buffer

View File

@ -190,6 +190,7 @@ void sha512_starts( sha512_context *ctx, int is384 )
ctx->is384 = is384;
}
#if !defined(POLARSSL_SHA512_PROCESS_ALT)
void sha512_process( sha512_context *ctx, const unsigned char data[128] )
{
int i;
@ -258,6 +259,7 @@ void sha512_process( sha512_context *ctx, const unsigned char data[128] )
ctx->state[6] += G;
ctx->state[7] += H;
}
#endif /* !POLARSSL_SHA512_PROCESS_ALT */
/*
* SHA-512 process buffer