| 1 | from .TurboSHAKE128 import TurboSHAKE |
| 2 | |
| 3 | def new(**kwargs): |
| 4 | """Create a new TurboSHAKE256 object. |
| 5 | |
| 6 | Args: |
| 7 | domain (integer): |
| 8 | Optional - A domain separation byte, between 0x01 and 0x7F. |
| 9 | The default value is 0x1F. |
| 10 | data (bytes/bytearray/memoryview): |
| 11 | Optional - The very first chunk of the message to hash. |
| 12 | It is equivalent to an early call to :meth:`update`. |
| 13 | |
| 14 | :Return: A :class:`TurboSHAKE` object |
| 15 | """ |
| 16 | |
| 17 | domain_separation = kwargs.get('domain', 0x1F) |
| 18 | if not (0x01 <= domain_separation <= 0x7F): |
| 19 | raise ValueError("Incorrect domain separation value (%d)" % |
| 20 | domain_separation) |
| 21 | data = kwargs.get('data') |
| 22 | return TurboSHAKE(64, domain_separation, data=data) |