diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 2c061e3..a27bb08 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -35,8 +35,8 @@ const struct ltc_hash_descriptor chc_desc = { }; /** - Initialize the CHC state with a given cipher - @param cipher The index of the cipher you wish to bind + Initialize the CHC state with a given cipher + @param cipher The index of the cipher you wish to bind @return CRYPT_OK if successful */ int chc_register(int cipher) @@ -70,7 +70,7 @@ int chc_register(int cipher) } /* store into descriptor */ - hash_descriptor[idx].hashsize = + hash_descriptor[idx].hashsize = hash_descriptor[idx].blocksize = cipher_descriptor[cipher].block_length; /* store the idx and block size */ @@ -89,7 +89,7 @@ int chc_init(hash_state *md) symmetric_key *key; unsigned char buf[MAXBLOCKSIZE]; int err; - + LTC_ARGCHK(md != NULL); /* is the cipher valid? */ @@ -105,7 +105,7 @@ int chc_init(hash_state *md) return CRYPT_MEM; } - /* zero key and what not */ + /* zero key and what not */ zeromem(buf, cipher_blocksize); if ((err = cipher_descriptor[cipher_idx].setup(buf, cipher_blocksize, 0, key)) != CRYPT_OK) { XFREE(key); @@ -123,7 +123,7 @@ int chc_init(hash_state *md) return CRYPT_OK; } -/* +/* key <= state T0,T1 <= block T0 <= encrypt T0 @@ -248,7 +248,7 @@ int chc_done(hash_state *md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int chc_test(void) { static const struct { @@ -258,7 +258,7 @@ int chc_test(void) } tests[] = { { (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 }, 16 } diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 654d00d..a0f94c7 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -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 */ - /* construct the SEQUENCE + /* construct the SEQUENCE SEQUENCE { SEQUENCE {hashoid OID 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, 1, LTC_ASN1_NULL, NULL, 0); LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); - + if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { XFREE(out); goto bail_2;