aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-10-19 08:42:28 -0400
committerNick Mathewson <nickm@torproject.org>2018-10-19 08:42:28 -0400
commitd1d66866b2c5e4e7ce246008f62f74d979cd8351 (patch)
treef1f366656bf8f47cc1ccb6ed7df504e503bada74 /src/lib
parentf8a1dc64f975bcaa74634f4666e448ca3fe88d3b (diff)
downloadtor-d1d66866b2c5e4e7ce246008f62f74d979cd8351.tar.gz
tor-d1d66866b2c5e4e7ce246008f62f74d979cd8351.zip
Rename a function; it is used to convert a value _From_ le.
We can't use htons()/ntohs() -- those are no-ops on exactly the wrong platforms.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/crypt_ops/crypto_ope.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/crypt_ops/crypto_ope.c b/src/lib/crypt_ops/crypto_ope.c
index 47e2461274..789517eba2 100644
--- a/src/lib/crypt_ops/crypto_ope.c
+++ b/src/lib/crypt_ops/crypto_ope.c
@@ -49,16 +49,16 @@ struct crypto_ope_t {
typedef uint16_t ope_val_t;
#ifdef WORDS_BIGENDIAN
-/** Convert an OPE value to little-endian */
+/** Convert an OPE value from little-endian. */
static inline ope_val_t
-ope_val_to_le(ope_val_t x)
+ope_val_from_le(ope_val_t x)
{
return
((x) >> 8) |
(((x)&0xff) << 8);
}
#else
-#define ope_val_to_le(x) (x)
+#define ope_val_from_le(x) (x)
#endif
/**
@@ -104,7 +104,7 @@ sum_values_from_cipher(crypto_cipher_t *c, size_t n)
crypto_cipher_crypt_inplace(c, (char*)buf, BUFSZ*sizeof(ope_val_t));
for (i = 0; i < BUFSZ; ++i) {
- total += ope_val_to_le(buf[i]);
+ total += ope_val_from_le(buf[i]);
total += 1;
}
n -= BUFSZ;
@@ -113,7 +113,7 @@ sum_values_from_cipher(crypto_cipher_t *c, size_t n)
memset(buf, 0, n*sizeof(ope_val_t));
crypto_cipher_crypt_inplace(c, (char*)buf, n*sizeof(ope_val_t));
for (i = 0; i < n; ++i) {
- total += ope_val_to_le(buf[i]);
+ total += ope_val_from_le(buf[i]);
total += 1;
}