Loading src/common/aes.c +2 −2 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len, /* XXXX This function is up to 5% of our runtime in some profiles; * we should look into unrolling some of the loops; taking advantage * of alignmement, using a bigger buffer, and so on. Not till after 0.1.2.x, * of alignment, using a bigger buffer, and so on. Not till after 0.1.2.x, * though. */ int c = cipher->pos; if (PREDICT_UNLIKELY(!len)) return; Loading Loading @@ -322,7 +322,7 @@ aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len) /* XXXX This function is up to 5% of our runtime in some profiles; * we should look into unrolling some of the loops; taking advantage * of alignmement, using a bigger buffer, and so on. Not till after 0.1.2.x, * of alignment, using a bigger buffer, and so on. Not till after 0.1.2.x, * though. */ int c = cipher->pos; if (PREDICT_UNLIKELY(!len)) return; Loading src/common/crypto.c +15 −14 Original line number Diff line number Diff line Loading @@ -1550,12 +1550,12 @@ crypto_dh_compute_secret(crypto_dh_env_t *dh, goto error; } secret_len = result; /* sometimes secret_len might be less than 128, e.g., 127. that's ok. */ /* sometimes secret_len might be less than 128, e.g., 127. that's ok. -RD */ /* Actually, http://www.faqs.org/rfcs/rfc2631.html says: * Leading zeros MUST be preserved, so that ZZ occupies as many * octets as p. For instance, if p is 1024 bits, ZZ should be 128 * bytes long. * What are the security implications here? * XXX021 What are the security implications here? -NM */ if (crypto_expand_key_material(secret_tmp, secret_len, secret_out, secret_bytes_out)<0) Loading @@ -1578,7 +1578,7 @@ crypto_dh_compute_secret(crypto_dh_env_t *dh, /** Given <b>key_in_len</b> bytes of negotiated randomness in <b>key_in</b> * ("K"), expand it into <b>key_out_len</b> bytes of negotiated key material in * <b>key_out</b> by taking the first key_out_len bytes of * <b>key_out</b> by taking the first <b>key_out_len</b> bytes of * H(K | [00]) | H(K | [01]) | .... * * Return 0 on success, -1 on failure. Loading Loading @@ -1710,7 +1710,7 @@ crypto_seed_rng(void) #endif } /** Write n bytes of strong random data to <b>to</b>. Return 0 on /** Write <b>n</b> bytes of strong random data to <b>to</b>. Return 0 on * success, -1 on failure. */ int Loading @@ -1725,7 +1725,7 @@ crypto_rand(char *to, size_t n) } /** Return a pseudorandom integer, chosen uniformly from the values * between 0 and max-1. */ * between 0 and <b>max</b>-1. */ int crypto_rand_int(unsigned int max) { Loading @@ -1746,8 +1746,8 @@ crypto_rand_int(unsigned int max) } } /** Return a pseudorandom integer, chosen uniformly from the values * between 0 and max-1. */ /** Return a pseudorandom 64-bit integer, chosen uniformly from the values * between 0 and <b>max</b>-1. */ uint64_t crypto_rand_uint64(uint64_t max) { Loading @@ -1768,9 +1768,10 @@ crypto_rand_uint64(uint64_t max) } } /** Generate and return a new random hostname starting with prefix, ending * with suffix, and containing between min_rand_len and max_rand_len random * base32 characters between. */ /** Generate and return a new random hostname starting with <b>prefix</b>, * ending with <b>suffix</b>, and containing no less than * <b>min_rand_len</b> and no more than <b>max_rand_len</b> random base32 * characters between. */ char * crypto_random_hostname(int min_rand_len, int max_rand_len, const char *prefix, const char *suffix) Loading Loading @@ -1799,8 +1800,8 @@ crypto_random_hostname(int min_rand_len, int max_rand_len, const char *prefix, return result; } /** Return a randomly chosen element of sl; or NULL if sl is empty. */ /** Return a randomly chosen element of <b>sl</b>; or NULL if <b>sl</b> * is empty. */ void * smartlist_choose(const smartlist_t *sl) { Loading @@ -1811,7 +1812,7 @@ smartlist_choose(const smartlist_t *sl) return NULL; /* no elements to choose from */ } /** Scramble the elements of sl into a random order. */ /** Scramble the elements of <b>sl</b> into a random order. */ void smartlist_shuffle(smartlist_t *sl) { Loading @@ -1834,7 +1835,7 @@ smartlist_shuffle(smartlist_t *sl) int base64_encode(char *dest, size_t destlen, const char *src, size_t srclen) { /* XXXX we might want to rewrite this along the lines of base64_decode, if /* FFFF we might want to rewrite this along the lines of base64_decode, if * it ever shows up in the profile. */ EVP_ENCODE_CTX ctx; int len, ret; Loading src/common/mempool.c +1 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ add_newly_used_chunk_to_used_list(mp_pool_t *pool, mp_chunk_t *chunk) ASSERT(!chunk->prev); } /** Return an newly allocated item from <b>pool</b>. */ /** Return a newly allocated item from <b>pool</b>. */ void * mp_pool_get(mp_pool_t *pool) { Loading src/common/mempool.h +3 −3 Original line number Diff line number Diff line Loading @@ -50,11 +50,11 @@ struct mp_pool_t { * padding. */ size_t item_alloc_size; #ifdef MEMPOOL_STATS /** Total number of items allocated ever */ /** Total number of items allocated ever. */ uint64_t total_items_allocated; /** Total number of chunks allocated ever */ /** Total number of chunks allocated ever. */ uint64_t total_chunks_allocated; /** Total number of chunks freed ever */ /** Total number of chunks freed ever. */ uint64_t total_chunks_freed; #endif }; Loading src/common/tortls.c +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ always_accept_verify_cb(int preverify_ok, return 1; } /** Return a newly allocated X509 name with commonName <b>cname</b> */ /** Return a newly allocated X509 name with commonName <b>cname</b>. */ static X509_NAME * tor_x509_name_new(const char *cname) { Loading Loading
src/common/aes.c +2 −2 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len, /* XXXX This function is up to 5% of our runtime in some profiles; * we should look into unrolling some of the loops; taking advantage * of alignmement, using a bigger buffer, and so on. Not till after 0.1.2.x, * of alignment, using a bigger buffer, and so on. Not till after 0.1.2.x, * though. */ int c = cipher->pos; if (PREDICT_UNLIKELY(!len)) return; Loading Loading @@ -322,7 +322,7 @@ aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len) /* XXXX This function is up to 5% of our runtime in some profiles; * we should look into unrolling some of the loops; taking advantage * of alignmement, using a bigger buffer, and so on. Not till after 0.1.2.x, * of alignment, using a bigger buffer, and so on. Not till after 0.1.2.x, * though. */ int c = cipher->pos; if (PREDICT_UNLIKELY(!len)) return; Loading
src/common/crypto.c +15 −14 Original line number Diff line number Diff line Loading @@ -1550,12 +1550,12 @@ crypto_dh_compute_secret(crypto_dh_env_t *dh, goto error; } secret_len = result; /* sometimes secret_len might be less than 128, e.g., 127. that's ok. */ /* sometimes secret_len might be less than 128, e.g., 127. that's ok. -RD */ /* Actually, http://www.faqs.org/rfcs/rfc2631.html says: * Leading zeros MUST be preserved, so that ZZ occupies as many * octets as p. For instance, if p is 1024 bits, ZZ should be 128 * bytes long. * What are the security implications here? * XXX021 What are the security implications here? -NM */ if (crypto_expand_key_material(secret_tmp, secret_len, secret_out, secret_bytes_out)<0) Loading @@ -1578,7 +1578,7 @@ crypto_dh_compute_secret(crypto_dh_env_t *dh, /** Given <b>key_in_len</b> bytes of negotiated randomness in <b>key_in</b> * ("K"), expand it into <b>key_out_len</b> bytes of negotiated key material in * <b>key_out</b> by taking the first key_out_len bytes of * <b>key_out</b> by taking the first <b>key_out_len</b> bytes of * H(K | [00]) | H(K | [01]) | .... * * Return 0 on success, -1 on failure. Loading Loading @@ -1710,7 +1710,7 @@ crypto_seed_rng(void) #endif } /** Write n bytes of strong random data to <b>to</b>. Return 0 on /** Write <b>n</b> bytes of strong random data to <b>to</b>. Return 0 on * success, -1 on failure. */ int Loading @@ -1725,7 +1725,7 @@ crypto_rand(char *to, size_t n) } /** Return a pseudorandom integer, chosen uniformly from the values * between 0 and max-1. */ * between 0 and <b>max</b>-1. */ int crypto_rand_int(unsigned int max) { Loading @@ -1746,8 +1746,8 @@ crypto_rand_int(unsigned int max) } } /** Return a pseudorandom integer, chosen uniformly from the values * between 0 and max-1. */ /** Return a pseudorandom 64-bit integer, chosen uniformly from the values * between 0 and <b>max</b>-1. */ uint64_t crypto_rand_uint64(uint64_t max) { Loading @@ -1768,9 +1768,10 @@ crypto_rand_uint64(uint64_t max) } } /** Generate and return a new random hostname starting with prefix, ending * with suffix, and containing between min_rand_len and max_rand_len random * base32 characters between. */ /** Generate and return a new random hostname starting with <b>prefix</b>, * ending with <b>suffix</b>, and containing no less than * <b>min_rand_len</b> and no more than <b>max_rand_len</b> random base32 * characters between. */ char * crypto_random_hostname(int min_rand_len, int max_rand_len, const char *prefix, const char *suffix) Loading Loading @@ -1799,8 +1800,8 @@ crypto_random_hostname(int min_rand_len, int max_rand_len, const char *prefix, return result; } /** Return a randomly chosen element of sl; or NULL if sl is empty. */ /** Return a randomly chosen element of <b>sl</b>; or NULL if <b>sl</b> * is empty. */ void * smartlist_choose(const smartlist_t *sl) { Loading @@ -1811,7 +1812,7 @@ smartlist_choose(const smartlist_t *sl) return NULL; /* no elements to choose from */ } /** Scramble the elements of sl into a random order. */ /** Scramble the elements of <b>sl</b> into a random order. */ void smartlist_shuffle(smartlist_t *sl) { Loading @@ -1834,7 +1835,7 @@ smartlist_shuffle(smartlist_t *sl) int base64_encode(char *dest, size_t destlen, const char *src, size_t srclen) { /* XXXX we might want to rewrite this along the lines of base64_decode, if /* FFFF we might want to rewrite this along the lines of base64_decode, if * it ever shows up in the profile. */ EVP_ENCODE_CTX ctx; int len, ret; Loading
src/common/mempool.c +1 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ add_newly_used_chunk_to_used_list(mp_pool_t *pool, mp_chunk_t *chunk) ASSERT(!chunk->prev); } /** Return an newly allocated item from <b>pool</b>. */ /** Return a newly allocated item from <b>pool</b>. */ void * mp_pool_get(mp_pool_t *pool) { Loading
src/common/mempool.h +3 −3 Original line number Diff line number Diff line Loading @@ -50,11 +50,11 @@ struct mp_pool_t { * padding. */ size_t item_alloc_size; #ifdef MEMPOOL_STATS /** Total number of items allocated ever */ /** Total number of items allocated ever. */ uint64_t total_items_allocated; /** Total number of chunks allocated ever */ /** Total number of chunks allocated ever. */ uint64_t total_chunks_allocated; /** Total number of chunks freed ever */ /** Total number of chunks freed ever. */ uint64_t total_chunks_freed; #endif }; Loading
src/common/tortls.c +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ always_accept_verify_cb(int preverify_ok, return 1; } /** Return a newly allocated X509 name with commonName <b>cname</b> */ /** Return a newly allocated X509 name with commonName <b>cname</b>. */ static X509_NAME * tor_x509_name_new(const char *cname) { Loading