More comment changes required for indent

Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
Matt Caswell
2015-01-22 02:41:39 +00:00
parent 117e79dd88
commit 9d03aabea3
11 changed files with 135 additions and 75 deletions

View File

@@ -91,8 +91,9 @@ int main(int argc, char *argv[])
static int AESTest(EVP_CIPHER_CTX *ctx,
char *amode, int akeysz, unsigned char *aKey,
unsigned char *iVec,
int dir, /* 0 = decrypt, 1 = encrypt */
unsigned char *iVec,
/* 0 = decrypt, 1 = encrypt */
int dir,
unsigned char *plaintext, unsigned char *ciphertext, int len)
{
const EVP_CIPHER *cipher = NULL;
@@ -296,8 +297,9 @@ static int do_mct(char *amode,
case ECB:
if (j == 0)
{ /* set up encryption */
ret = AESTest(&ctx, amode, akeysz, key[i], NULL,
dir, /* 0 = decrypt, 1 = encrypt */
ret = AESTest(&ctx, amode, akeysz, key[i], NULL,
/* 0 = decrypt, 1 = encrypt */
dir,
ptext[j], ctext[j], len);
if (dir == XENCRYPT)
memcpy(ptext[j+1], ctext[j], len);
@@ -324,8 +326,9 @@ static int do_mct(char *amode,
case CFB128:
if (j == 0)
{
ret = AESTest(&ctx, amode, akeysz, key[i], iv[i],
dir, /* 0 = decrypt, 1 = encrypt */
ret = AESTest(&ctx, amode, akeysz, key[i], iv[i],
/* 0 = decrypt, 1 = encrypt */
dir,
ptext[j], ctext[j], len);
if (dir == XENCRYPT)
memcpy(ptext[j+1], iv[i], len);
@@ -351,7 +354,8 @@ static int do_mct(char *amode,
if (j == 0)
{
ret = AESTest(&ctx, amode, akeysz, key[i], iv[i],
dir, /* 0 = decrypt, 1 = encrypt */
/* 0 = decrypt, 1 = encrypt */
dir,
ptext[j], ctext[j], len);
}
else
@@ -423,7 +427,8 @@ static int do_mct(char *amode,
if (dir == XENCRYPT)
{
if (imode == CFB8)
{ /* ct = CT[j-15] || CT[j-14] || ... || CT[j] */
{
/* ct = CT[j-15] || CT[j-14] || ... || CT[j] */
for (n1 = 0, n2 = nkeysz-1; n1 < nkeysz; ++n1, --n2)
ciphertext[n1] = ctext[j-n2][0];
}
@@ -451,7 +456,8 @@ static int do_mct(char *amode,
else
{
if (imode == CFB8)
{ /* ct = CT[j-15] || CT[j-14] || ... || CT[j] */
{
/* ct = CT[j-15] || CT[j-14] || ... || CT[j] */
for (n1 = 0, n2 = nkeysz-1; n1 < nkeysz; ++n1, --n2)
ciphertext[n1] = ptext[j-n2][0];
}
@@ -782,7 +788,8 @@ static int proc_file(char *rqfile, char *rspfile)
else
{
ret = AESTest(&ctx, amode, akeysz, aKey, iVec,
dir, /* 0 = decrypt, 1 = encrypt */
/* 0 = decrypt, 1 = encrypt */
dir,
plaintext, ciphertext, len);
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
!strcmp(amode,"CFB1"));
@@ -820,7 +827,8 @@ static int proc_file(char *rqfile, char *rspfile)
else
{
ret = AESTest(&ctx, amode, akeysz, aKey, iVec,
dir, /* 0 = decrypt, 1 = encrypt */
/* 0 = decrypt, 1 = encrypt */
dir,
plaintext, ciphertext, len);
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
!strcmp(amode,"CFB1"));

View File

@@ -90,8 +90,9 @@ int main(int argc, char *argv[])
static int DESTest(EVP_CIPHER_CTX *ctx,
char *amode, int akeysz, unsigned char *aKey,
unsigned char *iVec,
int dir, /* 0 = decrypt, 1 = encrypt */
unsigned char *iVec,
/* 0 = decrypt, 1 = encrypt */
int dir,
unsigned char *out, unsigned char *in, int len)
{
const EVP_CIPHER *cipher = NULL;
@@ -544,8 +545,9 @@ static int proc_file(char *rqfile, char *rspfile)
else
{
assert(dir == 1);
ret = DESTest(&ctx, amode, akeysz, aKey, iVec,
dir, /* 0 = decrypt, 1 = encrypt */
ret = DESTest(&ctx, amode, akeysz, aKey, iVec,
/* 0 = decrypt, 1 = encrypt */
dir,
ciphertext, plaintext, len);
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
!strcmp(amode,"CFB1"));
@@ -584,7 +586,8 @@ static int proc_file(char *rqfile, char *rspfile)
{
assert(dir == 0);
ret = DESTest(&ctx, amode, akeysz, aKey, iVec,
dir, /* 0 = decrypt, 1 = encrypt */
/* 0 = decrypt, 1 = encrypt */
dir,
plaintext, ciphertext, len);
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
!strcmp(amode,"CFB1"));

View File

@@ -84,7 +84,8 @@ static void *instruction_pointer(void)
__asm __volatile ( "move %1,$31\n\t" /* save ra */
"bal .+8; nop\n\t"
"move %0,$31\n\t"
"move $31,%1" /* restore ra */
/* restore ra */
"move $31,%1"
: "=r"(ret),"=r"(scratch) );
# elif defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || \
defined(__POWERPC__) || defined(_POWER) || defined(__PPC__) || \

View File

@@ -304,11 +304,12 @@ static BN_BLINDING *rsa_get_blinding(RSA *rsa, int *local, BN_CTX *ctx)
{
/* resort to rsa->mt_blinding instead */
*local = 0; /* instructs rsa_blinding_convert(), rsa_blinding_invert()
* that the BN_BLINDING is shared, meaning that accesses
* require locks, and that the blinding factor must be
* stored outside the BN_BLINDING
*/
/* instructs rsa_blinding_convert(), rsa_blinding_invert()
* that the BN_BLINDING is shared, meaning that accesses
* require locks, and that the blinding factor must be
* stored outside the BN_BLINDING
*/
*local = 0;
if (rsa->mt_blinding == NULL)
{