Unify coding style

@sjaeckel integrated clang-format with formal coding style. Run his
script and commit changes.

There are pros and cons of this commit.

Mixed coding style is a "broken window". A good single style simplifies
reading and writing code.

On the other hand, this is a big change which will lead to conflicts.
This commit is contained in:
Dmitry Podgorny
2020-01-03 22:02:22 +02:00
parent eef07cef36
commit 562a06425b
62 changed files with 3972 additions and 3746 deletions

View File

@@ -29,8 +29,10 @@
static const uint8_t ipad = 0x36;
static const uint8_t opad = 0x5C;
static void crypto_HMAC_SHA1(const uint8_t *key, size_t key_len,
const uint8_t *text, size_t len,
static void crypto_HMAC_SHA1(const uint8_t *key,
size_t key_len,
const uint8_t *text,
size_t len,
uint8_t *digest)
{
uint8_t key_pad[HMAC_BLOCK_SIZE];
@@ -64,11 +66,14 @@ static void crypto_HMAC_SHA1(const uint8_t *key, size_t key_len,
crypto_SHA1_Final(&ctx, digest);
}
static void SCRAM_SHA1_Hi(const uint8_t *text, size_t len,
const uint8_t *salt, size_t salt_len, uint32_t i,
static void SCRAM_SHA1_Hi(const uint8_t *text,
size_t len,
const uint8_t *salt,
size_t salt_len,
uint32_t i,
uint8_t *digest)
{
int k;
int k;
uint32_t j;
uint8_t tmp[128];
@@ -97,8 +102,11 @@ static void SCRAM_SHA1_Hi(const uint8_t *text, size_t len,
}
}
void SCRAM_SHA1_ClientKey(const uint8_t *password, size_t len,
const uint8_t *salt, size_t salt_len, uint32_t i,
void SCRAM_SHA1_ClientKey(const uint8_t *password,
size_t len,
const uint8_t *salt,
size_t salt_len,
uint32_t i,
uint8_t *key)
{
uint8_t salted[SHA1_DIGEST_SIZE];
@@ -111,7 +119,8 @@ void SCRAM_SHA1_ClientKey(const uint8_t *password, size_t len,
}
void SCRAM_SHA1_ClientSignature(const uint8_t *ClientKey,
const uint8_t *AuthMessage, size_t len,
const uint8_t *AuthMessage,
size_t len,
uint8_t *sign)
{
uint8_t stored[SHA1_DIGEST_SIZE];