# Brief: Computes GNUNET style Content Hash Key for a given file
# Author: Sree Harsha Totakura
+from __future__ import print_function
+from __future__ import division
+from builtins import str
+from builtins import range
+from past.utils import old_div
+from builtins import object
from hashlib import sha512
import logging
import os
return hash_obj.digest()
-class AESKey:
+class AESKey(object):
"""Class for AES Keys. Contains the main key and the initialization
vector. """
return ptext
-class Chk:
+class Chk(object):
"""Class for the content hash key."""
key = None
query = None
bds = compute_tree_size_(depth)
if (depth > 0):
end_offset -= 1
- ret = end_offset / bds
+ ret = old_div(end_offset, bds)
return ret % CHK_PER_INODE
ret = CHK_PER_INODE
else:
bds /= CHK_PER_INODE
- ret = mod / bds
+ ret = old_div(mod, bds)
if (mod % bds) is not 0:
ret += 1
return ret