MCPcopy Create free account
hub / github.com/secdev/scapy / new_mac

Method new_mac

scapy/layers/ipsec.py:662–670  ·  view source on GitHub ↗

:param key: a byte string :returns: an initialized mac object for this algo

(self, key)

Source from the content-addressed store, hash-verified

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 """

Callers 2

signMethod · 0.95
verifyMethod · 0.95

Calls 1

macMethod · 0.45

Tested by

no test coverage detected