:param key: a byte string :returns: an initialized mac object for this algo
(self, key)
| 660 | |
| 661 | @crypto_validator |
| 662 | def new_mac(self, key): |
| 663 | """ |
| 664 | :param key: a byte string |
| 665 | :returns: an initialized mac object for this algo |
| 666 | """ |
| 667 | if self.mac is CMAC: |
| 668 | return self.mac(self.digestmod(key), default_backend()) |
| 669 | else: |
| 670 | return self.mac(key, self.digestmod(), default_backend()) |
| 671 | |
| 672 | def sign(self, pkt, key, esn_en=False, esn=0): |
| 673 | """ |