/opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Signature/__pycache__
NameSizeModeActions
DSS.cpython-311.pyc182450644editdlrm
eddsa.cpython-311.pyc147550644editdlrm
pkcs1_15.cpython-311.pyc77360644editdlrm
PKCS1_PSS.cpython-311.pyc12190644editdlrm
PKCS1_v1_5.cpython-311.pyc11240644editdlrm
pss.cpython-311.pyc149610644editdlrm
__init__.cpython-311.pyc4320644editdlrm
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Signature/__pycache__/pss.cpython-311.pyc (14961B)
§ }�•�o×hãó€—ddlmZmZmZddlZddlmZmZmZddl m Z ddlm Z Gd„d¦«Z d„Z d „Zd „Zd „ZdS) é)ÚbchrÚbordÚ iter_rangeN)Úceil_divÚ long_to_bytesÚ bytes_to_long)Ústrxor)ÚRandomcó*—eZdZdZd„Zd„Zd„Zd„ZdS)Ú PSS_SigSchemezvA signature object for ``RSASSA-PSS``. Do not instantiate directly. Use :func:`Crypto.Signature.pss.new`. có>—||_||_||_||_dS)atInitialize this PKCS#1 PSS signature scheme object. :Parameters: key : an RSA key object If a private half is given, both signature and verification are possible. If a public half is given, only verification is possible. mgfunc : callable A mask generation function that accepts two parameters: a string to use as seed, and the lenth of the mask to generate, in bytes. saltLen : integer Length of the salt, in bytes. randfunc : callable A function that returns random bytes. N)Ú_keyÚ_saltLenÚ_mgfuncÚ _randfunc)ÚselfÚkeyÚmgfuncÚsaltLenÚrandfuncs úv/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Signature/pss.pyÚ__init__zPSS_SigScheme.__init__/s$€ð$ˆŒ ؈Œ ؈Œ Ø!ˆŒˆˆócó4—|j ¦«S)z`_. :parameter msg_hash: This is an object from the :mod:`Crypto.Hash` package. It has been used to digest the message to sign. :type msg_hash: hash object :return: the signature encoded as a *byte string*. :raise ValueError: if the RSA key is not long enough for the given hash algorithm. :raise TypeError: if the RSA key has no private half. Ncó&•—t||‰¦«S©N©ÚMGF1©ÚxÚyÚmsg_hashs €rúz$PSS_SigScheme.sign..bóø€�t A q¨(Ñ3Ô3€réé)rÚ digest_sizerÚCryptoÚUtilÚnumberÚsizerÚnrÚ_EMSA_PSS_ENCODErrÚ_decryptr) rr%ÚsLenÚmgfÚmodBitsÚkÚemÚem_intÚm_intÚ signatures ` rÚsignzPSS_SigScheme.signJs¼ø€ð$ Œ=Ð ØÔ'ˆDˆDà”=ˆDà Œ<Ð Ø3Ð3Ð3Ð3ˆCˆCà”,ˆCå”+Ô$×)Ò)¨$¬)¬+Ñ6Ô6ˆõ �W˜aÑ Ô ˆå ˜h¨°© °4´>À3ÈÑ MÔ Mˆå˜rÑ"Ô"ˆà” ×"Ò" 6Ñ*Ô*ˆå! %¨Ñ+Ô+ˆ ØÐrcóà‡—|j€‰j}n|j}|jr|j}nˆfd„}tjj |jj¦«}t|d¦«}t|¦«|krtd¦«‚t|¦«}|j  |¦«}t|dz d¦«} t|| ¦«} t‰| |dz ||¦«dS)apCheck if the PKCS#1 PSS signature over a message is valid. This function is also called ``RSASSA-PSS-VERIFY`` and it is specified in `section 8.1.2 of RFC8037 `_. :parameter msg_hash: The hash that was carried out over the message. This is an object belonging to the :mod:`Crypto.Hash` module. :type parameter: hash object :parameter signature: The signature that needs to be validated. :type signature: bytes :raise ValueError: if the signature is not valid. Ncó&•—t||‰¦«Srr r"s €rr&z&PSS_SigScheme.verify..�r'rr(úIncorrect signaturer))rr*rr+r,r-r.rr/rÚlenÚ ValueErrorrÚ_encryptrÚ_EMSA_PSS_VERIFY) rr%r9r2r3r4r5Ú signature_intr7ÚemLenr6s ` rÚverifyzPSS_SigScheme.verifytsðø€ð( Œ=Ð ØÔ'ˆDˆDà”=ˆDØ Œ<ð 4Ø”,ˆCˆCà3Ð3Ð3Ð3ˆCå”+Ô$×)Ò)¨$¬)¬+Ñ6Ô6ˆõ �W˜aÑ Ô ˆå ˆy‰>Œ>˜QÒ Ð ÝÐ2Ñ3Ô3Ð 3å% iÑ0Ô0ˆ à”×#Ò# MÑ2Ô2ˆå˜ 1™ aÑ(Ô(ˆÝ ˜6 5Ñ )Ô )ˆå˜ 2 w¨q¡y°#°tÑ<Ô<Ð<Ð<Ð`_. :param mfgSeed: seed from which the mask is generated :type mfgSeed: byte string :param maskLen: intended length in bytes of the mask :type maskLen: integer :param hash_gen: A module or a hash object from :mod:`Crypto.Hash` :type hash_object: :return: the mask, as a *byte string* réN)rrr*rÚnewÚupdateÚdigestr>)ÚmgfSeedÚmaskLenÚhash_genÚTÚcounterÚcÚhobjs rr!r!£s˜€ð& €AÝ�h w°Ô0DÑEÔEÑFÔFððˆÝ ˜' 1Ñ %Ô %ˆØ�|Š|‰~Œ~ˆØ � Š �G˜a‘KÑ Ô Ð Ø �— ’ ‘ ” Ñ ˆˆÝ ˆq‰6Œ6�WÒ Ð Ð Ð Ø ˆXˆgˆXŒ;Ðrcóò—t|d¦«}d}td|z|z ¦«D] }|dz dz}Œ ||j|zdzkrtd¦«‚||¦«}t d¦«dz| ¦«z|z} | ¦«} |  | ¦«t d¦«||z |jz dz z} | t d¦«z|z} ||  ¦«||jz dz ¦«} t| | ¦«}t t|d¦«|z¦«|dd…z}||  ¦«zt d¦«z}|S) a Implement the ``EMSA-PSS-ENCODE`` function, as defined in PKCS#1 v2.1 (RFC3447, 9.1.1). The original ``EMSA-PSS-ENCODE`` actually accepts the message ``M`` as input, and hash it internally. Here, we expect that the message has already been hashed instead. :Parameters: mhash : hash object The hash object that holds the digest of the message being signed. emBits : int Maximum length of the final encoding, in bits. randFunc : callable An RNG function that accepts as only parameter an int, and returns a string of random bytes, to be used as salt. mgf : callable A mask generation function that accepts two parameters: a string to use as seed, and the lenth of the mask to generate, in bytes. sLen : int Length of the salt, in bytes. :Return: An ``emLen`` byte long string that encodes the hash (with ``emLen = \ceil(emBits/8)``). :Raise ValueError: When digest or salt length are too big. r(rr)é€éz6Digest or salt length are too long for given key size.Né¼) rrr*r?rrNrLrMr r)ÚmhashÚemBitsÚrandFuncr3r2rCÚlmaskÚiÚsaltÚm_primeÚhÚpsÚdbÚdbMaskÚmaskedDBr6s rr0r0Às‚€õ< �V˜QÑ Ô €Eð €EÝ ˜˜%™ ™Ñ 'Ô 'ð"ð"ˆØ˜‘ ˜TÑ!ˆˆð ˆuÔ  Ñ% aÑ'Ò'Ð'Ýð0ñ1ô1ð 1ð ˆ8�D‰>Œ>€Då�1‰gŒg�a‰i˜%Ÿ,š,™.œ.Ñ(¨4Ñ/€Gà � Š ‰ Œ €A؇H‚HˆWÑÔÐå ˆa‰Œ�%˜‘*˜UÔ.Ñ.¨qÑ0Ñ 1€Bà �d�1‰gŒg‰˜Ñ €Bà ˆS�—’‘”˜U 5Ô#4Ñ4°QÑ6Ñ 7Ô 7€Få�b˜&Ñ!Ô!€Hå•D˜ !œÑ%Ô%¨¨Ñ.Ñ/Ô/°(¸1¸2¸2´,Ñ>€Hà �A—H’H‘J”JÑ ¥ d¡¤Ñ +€BØ €Ircó—t|d¦«}d}td|z|z ¦«D] }|dz dz}Œ ||j|zdzkrtd¦«‚t |dd…¦«d krtd¦«‚|d||jz dz …}|||jz dz d…} |t |d¦«zrtd¦«‚|| ||jz dz ¦«} t || ¦«} tt | d¦«|z¦«| dd…z} |  td¦«||jz |z dz ztd¦«z¦«std¦«‚|dkr | | d…} nd } td¦«dz|  ¦«z| z} |  ¦«}|  | ¦«|  ¦«}| |krtd¦«‚dS) a« Implement the ``EMSA-PSS-VERIFY`` function, as defined in PKCS#1 v2.1 (RFC3447, 9.1.2). ``EMSA-PSS-VERIFY`` actually accepts the message ``M`` as input, and hash it internally. Here, we expect that the message has already been hashed instead. :Parameters: mhash : hash object The hash object that holds the digest of the message to be verified. em : string The signature to verify, therefore proving that the sender really signed the message that was received. emBits : int Length of the final encoding (em), in bits. mgf : callable A mask generation function that accepts two parameters: a string to use as seed, and the lenth of the mask to generate, in bytes. sLen : int Length of the salt, in bytes. :Raise ValueError: When the encoding is inconsistent, or the digest or salt lengths are too big. r(rr)rWrXr=éÿÿÿÿNrYr) rrr*r?Úordrr rÚ startswithrNrLrM)rZr6r[r3r2rCr]r^rerardrcr_r`rUÚhps rrArAs'€õ8 �V˜QÑ Ô €Eð €EÝ ˜˜%™ ™Ñ 'Ô 'ð"ð"ˆØ˜‘ ˜TÑ!ˆˆð ˆuÔ  Ñ% aÑ'Ò'Ð'ÝÐ.Ñ/Ô/Ð/å ˆ2ˆbˆcˆcŒ7�|„|�tÒÐÝÐ.Ñ/Ô/Ð/àÐ,�5˜Ô*Ñ*¨1Ñ,Ð,Ô-€HØ ˆ5�Ô"Ñ " 1Ñ $ RÐ 'Ô(€Aà �t�B�q”E‰{Œ{Ñð0ÝÐ.Ñ/Ô/Ð/à ˆS��E˜%Ô+Ñ+¨AÑ-Ñ .Ô .€Få �˜&Ñ !Ô !€Bå �d�2�a”5‰kŒk˜U˜FÑ"Ñ #Ô # b¨¨¨¤fÑ ,€Bà �=Š=�˜a™œ %¨Ô(9Ñ"9¸$Ñ">¸qÑ"@ÑAÅDÈÁGÄGÑKÑ LÔ Lð0ÝÐ.Ñ/Ô/Ð/à ˆa‚x€xØ�4�%�&�&Œzˆˆàˆå�1‰gŒg�a‰i˜%Ÿ,š,™.œ.Ñ(¨4Ñ/€Gà �9Š9‰;Œ;€D؇K‚K�ÑÔÐØ �ЉŒ€BàˆB‚w€wÝÐ.Ñ/Ô/Ð/ð€wrc ó,—| dd¦«}| dd¦«}| dd¦«}|€ tj}|r1tdt | ¦«¦«z¦«‚t ||||¦«S)aCreate an object for making or verifying PKCS#1 PSS signatures. :parameter rsa_key: The RSA key to use for signing or verifying the message. This is a :class:`Crypto.PublicKey.RSA` object. Signing is only possible when ``rsa_key`` is a **private** RSA key. :type rsa_key: RSA object :Keyword Arguments: * *mask_func* (``callable``) -- A function that returns the mask (as `bytes`). It must accept two parameters: a seed (as `bytes`) and the length of the data to return. If not specified, it will be the function :func:`MGF1` defined in `RFC8017 `_ and combined with the same hash algorithm applied to the message to sign or verify. If you want to use a different function, for instance still :func:`MGF1` but together with another hash, you can do:: from Crypto.Hash import SHA256 from Crypto.Signature.pss import MGF1 mgf = lambda x, y: MGF1(x, y, SHA256) * *salt_bytes* (``integer``) -- Length of the salt, in bytes. It is a value between 0 and ``emLen - hLen - 2``, where ``emLen`` is the size of the RSA modulus and ``hLen`` is the size of the digest applied to the message to sign or verify. The salt is generated internally, you don't need to provide it. If not specified, the salt length will be ``hLen``. If it is zero, the signature scheme becomes deterministic. Note that in some implementations such as OpenSSL the default salt length is ``emLen - hLen - 2`` (even though it is not more secure than ``hLen``). * *rand_func* (``callable``) -- A function that returns random ``bytes``, of the desired length. The default is :func:`Crypto.Random.get_random_bytes`. :return: a :class:`PSS_SigScheme` signature object Ú mask_funcNÚ salt_bytesÚ rand_funczUnknown keywords: )Úpopr Úget_random_bytesr?ÚstrÚkeysr )Úrsa_keyÚkwargsrlÚsalt_lenrns rrLrLIs�€ðd— ’ ˜;¨Ñ-Ô-€IØ�zŠz˜,¨Ñ-Ô-€HØ— ’ ˜;¨Ñ-Ô-€IØÐÝÔ+ˆ Ø ðDÝÐ-µ°F·K²K±M´MÑ0BÔ0BÑBÑCÔCÐCÝ ˜ )¨X°yÑ AÔ AÐAr)ÚCrypto.Util.py3compatrrrÚCrypto.Util.numberr+rrrÚCrypto.Util.strxorr r r r!r0rArLrIrrúrys ðð>9Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8ØÐÐÐð"ð"ð"ð"ð"ð"ð"ð"ð"ð"ð&Ð%Ð%Ð%Ð%Ð%ØÐÐÐÐÐðw=ðw=ðw=ðw=ðw=ñw=ôw=ðw=ðtððð:=ð=ð=ð@F0ðF0ðF0ðR9Bð9Bð9Bð9Bð9Br