catacomb/__init__.py: Don't try to convert text strings to `ByteString'.
[catacomb-python] / catacomb / __init__.py
index 22b1fdf..24f3a61 100644 (file)
@@ -192,7 +192,7 @@ bytes = ByteString.fromhex
 ### Symmetric encryption.
 
 class _tmp:
-  def encrypt(me, n, m, tsz = None, h = ByteString('')):
+  def encrypt(me, n, m, tsz = None, h = ByteString.zero(0)):
     if tsz is None: tsz = me.__class__.tagsz.default
     e = me.enc(n, len(h), len(m), tsz)
     if not len(h): a = None
@@ -200,7 +200,7 @@ class _tmp:
     c0 = e.encrypt(m)
     c1, t = e.done(aad = a)
     return c0 + c1, t
-  def decrypt(me, n, c, t, h = ByteString('')):
+  def decrypt(me, n, c, t, h = ByteString.zero(0)):
     d = me.dec(n, len(h), len(c), len(t))
     if not len(h): a = None
     else: a = d.aad().hash(h)