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

Method split_pkt

scapy/contrib/macsec.py:89–102  ·  view source on GitHub ↗

split the packet into associated data, plaintext or ciphertext, and optional ICV

(pkt, assoclen, icvlen=0)

Source from the content-addressed store, hash-verified

87
88 @staticmethod
89 def split_pkt(pkt, assoclen, icvlen=0):
90 """
91 split the packet into associated data, plaintext or ciphertext, and
92 optional ICV
93 """
94 data = raw(pkt)
95 assoc = data[:assoclen]
96 if icvlen:
97 icv = data[-icvlen:]
98 enc = data[assoclen:-icvlen]
99 else:
100 icv = b''
101 enc = data[assoclen:]
102 return assoc, enc, icv
103
104 def e_bit(self):
105 """returns the value of the E bit for packets sent through this SA"""

Callers 2

encryptMethod · 0.80
decryptMethod · 0.80

Calls 1

rawFunction · 0.90

Tested by

no test coverage detected