[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] add crypto_cipher_rewind to reverse crypto_cipher_advance
- To: or-cvs@freehaven.net
- Subject: [or-cvs] add crypto_cipher_rewind to reverse crypto_cipher_advance
- From: arma@seul.org (Roger Dingledine)
- Date: Tue, 23 Dec 2003 02:43:07 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Tue, 23 Dec 2003 02:43:24 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/common
Modified Files:
crypto.c crypto.h
Log Message:
add crypto_cipher_rewind to reverse crypto_cipher_advance
Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- crypto.c 17 Dec 2003 05:31:52 -0000 1.50
+++ crypto.c 23 Dec 2003 07:43:05 -0000 1.51
@@ -808,6 +808,12 @@
}
int
+crypto_cipher_rewind(crypto_cipher_env_t *env, long delta)
+{
+ return crypto_cipher_advance(env, -delta);
+}
+
+int
crypto_cipher_advance(crypto_cipher_env_t *env, long delta)
{
if (env->type == CRYPTO_CIPHER_AES_CTR) {
@@ -841,8 +847,8 @@
void
crypto_free_digest_env(crypto_digest_env_t *digest) {
- assert(digest);
- tor_free(digest);
+ if(digest)
+ free(digest);
}
void
Index: crypto.h
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- crypto.h 17 Dec 2003 05:31:52 -0000 1.27
+++ crypto.h 23 Dec 2003 07:43:05 -0000 1.28
@@ -92,6 +92,7 @@
int crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *from, unsigned int fromlen, unsigned char *to);
/* only implemented for CRYPTO_CIPHER_AES_CTR */
+int crypto_cipher_rewind(crypto_cipher_env_t *env, long delta);
int crypto_cipher_advance(crypto_cipher_env_t *env, long delta);
/* convenience function: wraps crypto_create_crypto_env, set_key, set_iv, and init. */