@classmethod
def _new_context(cls):
ctx = cls.Context()
- _LIB.sha1_init(ctypes.byref(ctx))
+ _LIB.nettle_sha1_init(ctypes.byref(ctx))
return ctx
def __init__(self, ctx_dict: Optional[dict]):
self.ctx = self._new_context()
def update(self, data):
- _LIB.sha1_update(ctypes.byref(self.ctx), len(data), data)
+ _LIB.nettle_sha1_update(ctypes.byref(self.ctx), len(data), data)
def digest(self):
"""Return the current digest and reset the hasher state."""
out = (ctypes.c_uint8 * self._DIGEST_SIZE)()
- _LIB.sha1_digest(ctypes.byref(self.ctx), self._DIGEST_SIZE, out)
+ _LIB.nettle_sha1_digest(ctypes.byref(self.ctx), self._DIGEST_SIZE, out)
return bytes(out)