Skip to content

Commit

Permalink
Clean up trailing white space in source files
Browse files Browse the repository at this point in the history
  • Loading branch information
utelle committed May 29, 2024
1 parent 41b3c6d commit 731f548
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 170 deletions.
12 changes: 6 additions & 6 deletions src/aes_hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ aesGenKeyEncrypt(const unsigned char* userKey, const int bits, unsigned char* ke
{
int numberOfRounds = (bits == 128) ? 10 : (bits == 192) ? 12 : (bits == 256) ? 14 : 0;
int rc = (!userKey || !keyData) ? -1 : (numberOfRounds > 0) ? 0 : -2;

if (rc == 0)
{
__m128i tempKey[_MAX_ROUNDS + 1];
Expand Down Expand Up @@ -347,7 +347,7 @@ aesDecryptCBC(const unsigned char* in,
int offset;
--numBlocks;
offset = numBlocks * 16;

/* Decrypt the last plain block. */
last_in = _mm_loadu_si128(&((__m128i*) in)[numBlocks]);
data = _mm_xor_si128(last_in, key[numberOfRounds - 0]);
Expand Down Expand Up @@ -477,7 +477,7 @@ aesGenKeyEncryptInternal(const unsigned char* userKey, const int bits, uint8x16_
int i;
int j;
int numberOfRounds = (bits == 128) ? 10 : (bits == 192) ? 12 : (bits == 256) ? 14 : 0;
int keyWords = bits / 32;
int keyWords = bits / 32;
int schedWords = (numberOfRounds + 1) * 4;

/*
Expand Down Expand Up @@ -538,7 +538,7 @@ aesGenKeyEncrypt(const unsigned char* userKey, const int bits, unsigned char* ke
{
int numberOfRounds = (bits == 128) ? 10 : (bits == 192) ? 12 : (bits == 256) ? 14 : 0;
int rc = (!userKey || !keyData) ? -1 : (numberOfRounds > 0) ? 0 : -2;

if (rc == 0)
{
uint8x16_t tempKey[_MAX_ROUNDS + 1];
Expand Down Expand Up @@ -648,7 +648,7 @@ aesEncryptCBC(const unsigned char* in,
}
feedback = vaeseq_u8(feedback, key[numberOfRounds-1]);
feedback = veorq_u8(feedback, key[numberOfRounds]); \

vst1q_u8(&out[(numBlocks-1)*16], feedback);

memcpy(&out[numBlocks*16], lastblock, lenFrag);
Expand Down Expand Up @@ -689,7 +689,7 @@ aesDecryptCBC(const unsigned char* in,
int offset;
--numBlocks;
offset = numBlocks * 16;

/* Decrypt the last plain block. */
last_in = vld1q_u8(&in[numBlocks*16]);

Expand Down
2 changes: 1 addition & 1 deletion src/ascon/pbkdf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void ascon_pbkdf2_f(ascon_state_t* state,
memset(temp, 0, ASCON_SALT_LEN);
memcpy(temp, salt, asconSaltLen);
STORE32_BE(temp+ASCON_SALT_LEN, blocknum);

/* Copy initial state */
for (j = 0; j < 5; ++j) state2.x[j] = state->x[j];

Expand Down
2 changes: 1 addition & 1 deletion src/ascon/prolog.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
** Name: prolog.h
** Purpose: Include important header files, before
** Purpose: Include important header files, before
** Based on: Public domain Ascon reference implementation
** and optimized variants for 32- and 64-bit
** (see https://github.com/ascon/ascon-c)
Expand Down
2 changes: 1 addition & 1 deletion src/chacha20poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static size_t entropy(void* buf, size_t n)
}

#else

#include <windows.h>
#define RtlGenRandom SystemFunction036
BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
Expand Down
2 changes: 1 addition & 1 deletion src/cipher_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ sqlite3mcConfigureSQLCipherVersion(sqlite3* db, int configDefault, int legacyVer
static char* defNames[] = { "default:legacy_page_size", "default:kdf_iter", "default:hmac_use", "default:kdf_algorithm", "default:hmac_algorithm", NULL };
static int versionParams[SQLCIPHER_VERSION_MAX][5] =
{
{ 1024, 4000, 0, SQLCIPHER_KDF_ALGORITHM_SHA1, SQLCIPHER_HMAC_ALGORITHM_SHA1 },
{ 1024, 4000, 0, SQLCIPHER_KDF_ALGORITHM_SHA1, SQLCIPHER_HMAC_ALGORITHM_SHA1 },
{ 1024, 4000, 1, SQLCIPHER_KDF_ALGORITHM_SHA1, SQLCIPHER_HMAC_ALGORITHM_SHA1 },
{ 1024, 64000, 1, SQLCIPHER_KDF_ALGORITHM_SHA1, SQLCIPHER_HMAC_ALGORITHM_SHA1 },
{ 4096, 256000, 1, SQLCIPHER_KDF_ALGORITHM_SHA512, SQLCIPHER_HMAC_ALGORITHM_SHA512 }
Expand Down
4 changes: 2 additions & 2 deletions src/codec_algos.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sqlite3mcAES128(Rijndael* aesCtx, int page, int encrypt, unsigned char encryptio
{
len = RijndaelBlockDecrypt(aesCtx, datain, datalen*8, dataout);
}

/* It is a good idea to check the error code */
if (len < 0)
{
Expand Down Expand Up @@ -185,7 +185,7 @@ sqlite3mcAES256(Rijndael* aesCtx, int page, int encrypt, unsigned char encryptio
{
len = RijndaelBlockDecrypt(aesCtx, datain, datalen*8, dataout);
}

/* It is a good idea to check the error code */
if (len < 0)
{
Expand Down
4 changes: 2 additions & 2 deletions src/codecext.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sqlite3_activate_see(const char *info)

/*
** Free the encryption data structure associated with a pager instance.
** (called from the modified code in pager.c)
** (called from the modified code in pager.c)
*/
SQLITE_PRIVATE void
sqlite3mcCodecFree(void *pCodecArg)
Expand Down Expand Up @@ -411,7 +411,7 @@ sqlite3_rekey_v2(sqlite3* db, const char* zDbName, const void* zKey, int nKey)
sqlite3ErrorWithMsg(db, rc, "Rekeying is not supported in WAL journal mode.");
return rc;
}

if ((zKey == NULL || nKey == 0) && (codec == NULL || !sqlite3mcIsEncrypted(codec)))
{
/* Database not encrypted and key not specified, therefore do nothing */
Expand Down
6 changes: 3 additions & 3 deletions src/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ static void uncompressFunc(
__declspec(dllexport)
#endif
int sqlite3_compress_init(
sqlite3 *db,
char **pzErrMsg,
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi
){
int rc = SQLITE_OK;
SQLITE_EXTENSION_INIT2(pApi);
(void)pzErrMsg; /* Unused parameter */
rc = sqlite3_create_function(db, "compress", 1,
rc = sqlite3_create_function(db, "compress", 1,
SQLITE_UTF8 | SQLITE_INNOCUOUS,
0, compressFunc, 0, 0);
if( rc==SQLITE_OK ){
Expand Down
Loading

0 comments on commit 731f548

Please sign in to comment.