trim trailing spaces

This commit is contained in:
Steffen Jaeckel 2014-08-07 01:33:35 +02:00
parent ff736a61bb
commit f8449f55d9
2 changed files with 11 additions and 11 deletions

View File

@ -35,8 +35,8 @@ const struct ltc_hash_descriptor chc_desc = {
}; };
/** /**
Initialize the CHC state with a given cipher Initialize the CHC state with a given cipher
@param cipher The index of the cipher you wish to bind @param cipher The index of the cipher you wish to bind
@return CRYPT_OK if successful @return CRYPT_OK if successful
*/ */
int chc_register(int cipher) int chc_register(int cipher)
@ -70,7 +70,7 @@ int chc_register(int cipher)
} }
/* store into descriptor */ /* store into descriptor */
hash_descriptor[idx].hashsize = hash_descriptor[idx].hashsize =
hash_descriptor[idx].blocksize = cipher_descriptor[cipher].block_length; hash_descriptor[idx].blocksize = cipher_descriptor[cipher].block_length;
/* store the idx and block size */ /* store the idx and block size */
@ -89,7 +89,7 @@ int chc_init(hash_state *md)
symmetric_key *key; symmetric_key *key;
unsigned char buf[MAXBLOCKSIZE]; unsigned char buf[MAXBLOCKSIZE];
int err; int err;
LTC_ARGCHK(md != NULL); LTC_ARGCHK(md != NULL);
/* is the cipher valid? */ /* is the cipher valid? */
@ -105,7 +105,7 @@ int chc_init(hash_state *md)
return CRYPT_MEM; return CRYPT_MEM;
} }
/* zero key and what not */ /* zero key and what not */
zeromem(buf, cipher_blocksize); zeromem(buf, cipher_blocksize);
if ((err = cipher_descriptor[cipher_idx].setup(buf, cipher_blocksize, 0, key)) != CRYPT_OK) { if ((err = cipher_descriptor[cipher_idx].setup(buf, cipher_blocksize, 0, key)) != CRYPT_OK) {
XFREE(key); XFREE(key);
@ -123,7 +123,7 @@ int chc_init(hash_state *md)
return CRYPT_OK; return CRYPT_OK;
} }
/* /*
key <= state key <= state
T0,T1 <= block T0,T1 <= block
T0 <= encrypt T0 T0 <= encrypt T0
@ -248,7 +248,7 @@ int chc_done(hash_state *md, unsigned char *out)
/** /**
Self-test the hash Self-test the hash
@return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled
*/ */
int chc_test(void) int chc_test(void)
{ {
static const struct { static const struct {
@ -258,7 +258,7 @@ int chc_test(void)
} tests[] = { } tests[] = {
{ {
(unsigned char *)"hello world", (unsigned char *)"hello world",
{ 0xcf, 0x57, 0x9d, 0xc3, 0x0a, 0x0e, 0xea, 0x61, { 0xcf, 0x57, 0x9d, 0xc3, 0x0a, 0x0e, 0xea, 0x61,
0x0d, 0x54, 0x47, 0xc4, 0x3c, 0x06, 0xf5, 0x4e }, 0x0d, 0x54, 0x47, 0xc4, 0x3c, 0x06, 0xf5, 0x4e },
16 16
} }

View File

@ -120,19 +120,19 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen,
} }
/* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */
/* construct the SEQUENCE /* construct the SEQUENCE
SEQUENCE { SEQUENCE {
SEQUENCE {hashoid OID SEQUENCE {hashoid OID
blah NULL blah NULL
} }
hash OCTET STRING hash OCTET STRING
} }
*/ */
LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0]));
LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0);
LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2);
LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen);
if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) {
XFREE(out); XFREE(out);
goto bail_2; goto bail_2;