aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-03 16:03:24 -0400
committerFranklin Wei <me@fwei.tk>2018-07-03 16:03:24 -0400
commit626224ade749f4429d5c098d8f27798da8405ca1 (patch)
tree70a7a9e818a807df3b447637b0b2dd40282a8f0a /crypto.c
parentb48c8121de03fd5da77976d710e92d1566e2d143 (diff)
downloadcsaa-626224ade749f4429d5c098d8f27798da8405ca1.zip
csaa-626224ade749f4429d5c098d8f27798da8405ca1.tar.gz
csaa-626224ade749f4429d5c098d8f27798da8405ca1.tar.bz2
csaa-626224ade749f4429d5c098d8f27798da8405ca1.tar.xz
Make constants all 64-bit
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto.c b/crypto.c
index e51b502..c965b1e 100644
--- a/crypto.c
+++ b/crypto.c
@@ -146,7 +146,7 @@ uint64_t *bintree_complement(uint64_t leafidx, int logleaves, int **orders)
*orders = calloc(logleaves, sizeof(int));
/* true index of leaf */
- uint64_t idx = (1 << logleaves) - 1 + leafidx;
+ uint64_t idx = ((uint64_t)1 << logleaves) - 1 + leafidx;
/* progress up the tree */
for(int i = 0; i < logleaves; ++i)
@@ -169,7 +169,7 @@ uint64_t *bintree_ancestors(uint64_t leafidx, int logleaves)
{
uint64_t *dep = calloc(logleaves, sizeof(uint64_t));
- uint64_t idx = (1 << logleaves) - 1 + leafidx;
+ uint64_t idx = ((uint64_t)1 << logleaves) - 1 + leafidx;
for(int i = 0; i < logleaves; ++i)
{
idx = bintree_parent(idx);