summaryrefslogtreecommitdiff
path: root/source/security_algorithms/sha/sha2.cpp
diff options
context:
space:
mode:
authorxmarvla <vlatko.markovic@seavus.com>2011-12-26 11:39:55 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2012-05-25 14:40:23 +0200
commitf2be658909048b1050bf66c14324cccce852a931 (patch)
tree6d706961731e8dd2864581491ae4ca8fc6574359 /source/security_algorithms/sha/sha2.cpp
parent7500cbd59a6faa7dd69b278d7a02da2c8fa96060 (diff)
Flash tool cli cannot work with network path
Resolve problems in error handling for process file command when path to non-existing file is given as input paramter to LCDriver. Fix AStyle code formatting. ST-Ericsson ID: 402761 ST-Ericsson FOSS-OUT ID: NA Change-Id: Ia6539a7ebab97a078bc0d105b23b6a0545762194 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43810 Reviewed-by: QABUILD Tested-by: Aleksandar GASOSKI <aleksandar.gasoski@seavus.com> Reviewed-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com> Tested-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com>
Diffstat (limited to 'source/security_algorithms/sha/sha2.cpp')
-rw-r--r--source/security_algorithms/sha/sha2.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/security_algorithms/sha/sha2.cpp b/source/security_algorithms/sha/sha2.cpp
index 647bf7d..f3986ca 100644
--- a/source/security_algorithms/sha/sha2.cpp
+++ b/source/security_algorithms/sha/sha2.cpp
@@ -468,8 +468,8 @@ void SHA256_Transform(SHA256_CTX *context, const sha2_word32 *data)
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
-/* Apply the SHA-256 compression function to update a..h with copy */
-T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
+ /* Apply the SHA-256 compression function to update a..h with copy */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
@@ -486,14 +486,14 @@ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
do {
/* Part of the message block expansion: */
- s0 = W256[(j+1)&0x0f];
+ s0 = W256[(j + 1) & 0x0f];
s0 = sigma0_256(s0);
- s1 = W256[(j+14)&0x0f];
+ s1 = W256[(j + 14) & 0x0f];
s1 = sigma1_256(s1);
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
- (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
+ (W256[j & 0x0f] += s1 + W256[(j + 9) & 0x0f] + s0);
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
g = f;
@@ -810,8 +810,8 @@ void SHA512_Transform(SHA512_CTX *context, const sha2_word64 *data)
/* Apply the SHA-512 compression function to update a..h */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
-/* Apply the SHA-512 compression function to update a..h with copy */
-T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
+ /* Apply the SHA-512 compression function to update a..h with copy */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_512(a) + Maj(a, b, c);
h = g;
@@ -828,14 +828,14 @@ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
do {
/* Part of the message block expansion: */
- s0 = W512[(j+1)&0x0f];
+ s0 = W512[(j + 1) & 0x0f];
s0 = sigma0_512(s0);
- s1 = W512[(j+14)&0x0f];
+ s1 = W512[(j + 14) & 0x0f];
s1 = sigma1_512(s1);
/* Apply the SHA-512 compression function to update a..h */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] +
- (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0);
+ (W512[j & 0x0f] += s1 + W512[(j + 9) & 0x0f] + s0);
T2 = Sigma0_512(a) + Maj(a, b, c);
h = g;
g = f;
@@ -957,7 +957,7 @@ void SHA512_Last(SHA512_CTX *context)
/* Store the length of input data (in bits): */
*(sha2_word64 *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
- *(sha2_word64 *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
+ *(sha2_word64 *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH + 8] = context->bitcount[0];
/* Final transform: */
SHA512_Transform(context, (sha2_word64 *)context->buffer);