Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
Add class attributes for BLAKE2b and BLAKE2s
Browse files Browse the repository at this point in the history
  • Loading branch information
xymy committed Mar 9, 2020
1 parent 7be40ea commit a505b3d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xycrypto/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ def finalize(self):

class BLAKE2b(ExtendableHash):
block_size = 128
max_digest_size = 64
max_key_size = 64
salt_size = 16
person_size = 16

def __init__(self, *, digest_size=64, key=b'', salt=b'', person=b'',
fanout=1, depth=1, leaf_size=0,
Expand All @@ -226,6 +230,10 @@ def __init__(self, *, digest_size=64, key=b'', salt=b'', person=b'',

class BLAKE2s(ExtendableHash):
block_size = 64
max_digest_size = 32
max_key_size = 32
salt_size = 8
person_size = 8

def __init__(self, *, digest_size=32, key=b'', salt=b'', person=b'',
fanout=1, depth=1, leaf_size=0,
Expand Down

0 comments on commit a505b3d

Please sign in to comment.