[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r13053: Remove some dead code. (in tor/trunk: . src/common)
Author: nickm
Date: 2008-01-07 11:50:33 -0500 (Mon, 07 Jan 2008)
New Revision: 13053
Modified:
tor/trunk/
tor/trunk/src/common/aes.h
tor/trunk/src/common/container.c
tor/trunk/src/common/crypto.c
Log:
r17491@catbus: nickm | 2008-01-07 11:50:24 -0500
Remove some dead code.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r17491] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/common/aes.h
===================================================================
--- tor/trunk/src/common/aes.h 2008-01-07 16:50:31 UTC (rev 13052)
+++ tor/trunk/src/common/aes.h 2008-01-07 16:50:33 UTC (rev 13053)
@@ -26,11 +26,6 @@
void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
char *output);
void aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv);
-#if 0
-uint64_t aes_get_counter(aes_cnt_cipher_t *cipher);
-void aes_set_counter(aes_cnt_cipher_t *cipher, uint64_t counter);
-void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta);
-#endif
#endif
Modified: tor/trunk/src/common/container.c
===================================================================
--- tor/trunk/src/common/container.c 2008-01-07 16:50:31 UTC (rev 13052)
+++ tor/trunk/src/common/container.c 2008-01-07 16:50:33 UTC (rev 13053)
@@ -499,16 +499,6 @@
smartlist_bsearch(smartlist_t *sl, const void *key,
int (*compare)(const void *key, const void **member))
{
-#if 0
- void ** r;
-
- if (!sl->num_used)
- return NULL;
-
- r = bsearch(key, sl->list, sl->num_used, sizeof(void*),
- (int (*)(const void *, const void *))compare);
- return r ? *r : NULL;
-#endif
int found, idx;
idx = smartlist_bsearch_idx(sl, key, compare, &found);
return found ? smartlist_get(sl, idx) : NULL;
Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c 2008-01-07 16:50:31 UTC (rev 13052)
+++ tor/trunk/src/common/crypto.c 2008-01-07 16:50:33 UTC (rev 13053)
@@ -1311,10 +1311,6 @@
memcpy(into,from,sizeof(crypto_digest_env_t));
}
-#if 0
-/**DOCDOC */
-#define DIGEST_BLOCKSIZE 64
-
/** Compute the HMAC-SHA-1 of the <b>msg_len</b> bytes in <b>msg</b>, using
* the <b>key</b> of length <b>key_len</b>. Store the DIGEST_LEN-byte result
* in <b>hmac_out</b>.
@@ -1324,52 +1320,6 @@
const char *key, size_t key_len,
const char *msg, size_t msg_len)
{
- SHA_CTX sha;
- uint8_t K[DIGEST_BLOCKSIZE], D[DIGEST_LEN], K_SHORT[DIGEST_LEN];
- const uint8_t *real_key;
- unsigned int i;
-
- if (key_len > DIGEST_BLOCKSIZE) {
- SHA1((const unsigned char*)key, key_len, K_SHORT);
- key_len = DIGEST_LEN;
- real_key = K_SHORT;
- } else {
- real_key = (const uint8_t*)key;
- }
-
- memset(K, 0, sizeof(K));
- memcpy(K, real_key, key_len);
- for (i=0; i < sizeof(K); ++i)
- K[i] ^= 0x36;
- SHA1_Init(&sha);
- SHA1_Update(&sha, K, sizeof(K));
- SHA1_Update(&sha, msg, msg_len);
- SHA1_Final(D, &sha);
-
- /*
- memset(K, 0, sizeof(K));
- memcpy(K, real_key, key_len);
- for (i=0; i < sizeof(K); ++i)
- K[i] ^= 0x5c;
- */
- for (i=0; i < sizeof(K); ++i)
- K[i] ^= (0x36 ^ 0x5c);
- SHA1_Init(&sha);
- SHA1_Update(&sha, K, sizeof(K));
- SHA1_Update(&sha, D, sizeof(D));
- SHA1_Final((unsigned char*)hmac_out, &sha);
-}
-#endif
-
-/** Compute the HMAC-SHA-1 of the <b>msg_len</b> bytes in <b>msg</b>, using
- * the <b>key</b> of length <b>key_len</b>. Store the DIGEST_LEN-byte result
- * in <b>hmac_out</b>.
- */
-void
-crypto_hmac_sha1(char *hmac_out,
- const char *key, size_t key_len,
- const char *msg, size_t msg_len)
-{
HMAC(EVP_sha1(), key, key_len, (unsigned char*)msg, msg_len,
(unsigned char*)hmac_out, NULL);
}