# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Cipher IDs================.. module:: pcapkit.const.hip.cipherThis module contains the constant enumeration for **Cipher IDs**,which is automatically generated from :class:`pcapkit.vendor.hip.cipher.Cipher`."""fromaenumimportIntEnum,extend_enum__all__=['Cipher']
[docs]classCipher(IntEnum):"""[Cipher] Cipher IDs"""#: RESERVED [:rfc:`7401`]RESERVED_0=0#: NULL-ENCRYPT [:rfc:`7401`]NULL_ENCRYPT=1#: AES-128-CBC [:rfc:`7401`]AES_128_CBC=2#: RESERVED [:rfc:`7401`]RESERVED_3=3#: AES-256-CBC [:rfc:`7401`]AES_256_CBC=4@staticmethoddefget(key:'int | str',default:'int'=-1)->'Cipher':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnCipher(key)ifkeynotinCipher._member_map_:# pylint: disable=no-memberreturnextend_enum(Cipher,key,default)returnCipher[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'Cipher':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=65535):raiseValueError('%r is not a valid %s'%(value,cls.__name__))if5<=value<=65535:#: Unassignedreturnextend_enum(cls,'Unassigned_%d'%value,value)returnsuper()._missing_(value)