https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/nacl/bindings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyc
�
y�\c@`s	ddlmZmZmZddlmZddlmZm	Z	ddl
mZe	j�Z
e	j�dZe	j�Ze	j�Ze	j�Ze	j�Zd�Zd�Zd�Zd	�Zd
�Zd�Zdefd
��YZd�Zd�Z d�Z!dS(i(tabsolute_importtdivisiontprint_function(t
exceptions(tffitlib(tensureicC`svtjdt�}tjdt�}tj||�}t|dkddtj�tj	|t�tj	|t�fS(su
    Returns a randomly generated public key and secret key.

    :rtype: (bytes(public_key), bytes(secret_key))
    sunsigned char[]isUnexpected library errortraising(
Rtnewtcrypto_sign_PUBLICKEYBYTEStcrypto_sign_SECRETKEYBYTESRtcrypto_sign_keypairRtexctRuntimeErrortbuffer(tpktsktrc((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR!s
cC`s�t|�tkr$tjd��ntjdt�}tjdt�}tj	|||�}t
|dkddtj�tj|t�tj|t�fS(s�
    Computes and returns the public key and secret key using the seed ``seed``.

    :param seed: bytes
    :rtype: (bytes(public_key), bytes(secret_key))
    sInvalid seedsunsigned char[]isUnexpected library errorR(
tlentcrypto_sign_SEEDBYTESRt
ValueErrorRRR	R
Rtcrypto_sign_seed_keypairRR
R(tseedRRR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR5s
cC`s}tjdt|�t�}tjd�}tj|||t|�|�}t|dkddtj�tj	||d�S(s�
    Signs the message ``message`` using the secret key ``sk`` and returns the
    signed message.

    :param message: bytes
    :param sk: bytes
    :rtype: bytes
    sunsigned char[]sunsigned long long *isUnexpected library errorR(
RRRtcrypto_sign_BYTESRtcrypto_signRRR
R(tmessageRtsignedt
signed_lenR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyRMs	!
cC`sutjdt|��}tjd�}tj|||t|�|�dkr`tjd��ntj||d�S(s�
    Verifies the signature of the signed message ``signed`` using the public
    key ``pk`` and returns the unsigned message.

    :param signed: bytes
    :param pk: bytes
    :rtype: bytes
    sunsigned char[]sunsigned long long *isSignature was forged or corrupt(RRRRtcrypto_sign_openRtBadSignatureErrorR(RRRtmessage_len((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyRas	!cC`s{t|�tkr$tjd��nt}tjd|�}tj||�}t	|dkddtj
�tj||�S(s
    Converts a public Ed25519 key (encoded as bytes ``public_key_bytes``) to
    a public Curve25519 key as bytes.

    Raises a ValueError if ``public_key_bytes`` is not of length
    ``crypto_sign_PUBLICKEYBYTES``

    :param public_key_bytes: bytes
    :rtype: bytes
    sInvalid curve public keysunsigned char[]isUnexpected library errorR(RR	RRtcrypto_sign_curve25519_BYTESRRRt$crypto_sign_ed25519_pk_to_curve25519RR
R(tpublic_key_bytestcurve_public_key_lentcurve_public_keyR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR ts		
cC`s{t|�tkr$tjd��nt}tjd|�}tj||�}t	|dkddtj
�tj||�S(s
    Converts a secret Ed25519 key (encoded as bytes ``secret_key_bytes``) to
    a secret Curve25519 key as bytes.

    Raises a ValueError if ``secret_key_bytes``is not of length
    ``crypto_sign_SECRETKEYBYTES``

    :param public_key_bytes: bytes
    :rtype: bytes
    sInvalid curve public keysunsigned char[]isUnexpected library errorR(RR
RRRRRRt$crypto_sign_ed25519_sk_to_curve25519RR
R(tsecret_key_bytestcurve_secret_key_lentcurve_secret_keyR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR$�s		
tcrypto_sign_ed25519ph_statecB`s eZdZdgZd�ZRS(sO
    State object wrapping the sha-512 state used in ed25519ph computation
    tstatecC`sGtjdt�|_tj|j�}t|dkddtj�dS(Nsunsigned char[]isUnexpected library errorR(	RRt crypto_sign_ed25519ph_STATEBYTESR)Rtcrypto_sign_ed25519ph_initRRR
(tselfR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyt__init__�s	(t__name__t
__module__t__doc__t	__slots__R-(((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR(�s	cC`s|tt|t�ddtj�tt|t�ddtj�tj|j|t	|��}t|dkddtj
�dS(s�
    Update the hash state wrapped in edph

    :param edph: the ed25519ph state being updated
    :type edph: crypto_sign_ed25519ph_state
    :param pmsg: the partial message
    :type pmsg: bytes
    :rtype: None
    s/edph parameter must be a ed25519ph_state objectRs%pmsg parameter must be a bytes objectisUnexpected library errorN(Rt
isinstanceR(Rt	TypeErrortbytesRtcrypto_sign_ed25519ph_updateR)RR
(tedphtpmsgR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR5�s


cC`s�tt|t�ddtj�tt|t�ddtj�tt|�tkdjt�dtj�t	j
dt�}tj
|j|t	j|�}t|dkddtj�t	j|t�S(sR
    Create a signature for the data hashed in edph
    using the secret key sk

    :param edph: the ed25519ph state for the data
                 being signed
    :type edph: crypto_sign_ed25519ph_state
    :param sk: the ed25519 secret part of the signing key
    :type sk: bytes
    :return: ed25519ph signature
    :rtype: bytes
    s/edph parameter must be a ed25519ph_state objectRs+secret key parameter must be a bytes objects!secret key must be {0} bytes longsunsigned char[]isUnexpected library error(RR2R(RR3R4RR
tformatRRRRt"crypto_sign_ed25519ph_final_createR)tNULLR
R(R6Rt	signatureR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR9�s&

	
	
cC`s�tt|t�ddtj�tt|t�ddtj�tt|�tkdjt�dtj�tt|t�ddtj�tt|�t	kdjt	�dtj�t
j|j||�}|dkr�tj
d��ntS(	s�
    Verify a prehashed signature using the public key pk

    :param edph: the ed25519ph state for the data
                 being verified
    :type edph: crypto_sign_ed25519ph_state
    :param signature: the signature being verified
    :type signature: bytes
    :param pk: the ed25519 public part of the signing key
    :type pk: bytes
    :return: True if the signature is valid
    :rtype: boolean
    :raises exc.BadSignatureError: if the signature is not valid
    s/edph parameter must be a ed25519ph_state objectRs*signature parameter must be a bytes objects signature must be {0} bytes longs+public key parameter must be a bytes objects!public key must be {0} bytes longisSignature was forged or corrupt(RR2R(RR3R4RRR8R	Rt"crypto_sign_ed25519ph_final_verifyR)RtTrue(R6R;RR((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyR<�s.

	

	
	N("t
__future__RRRtnaclRRtnacl._sodiumRRtnacl.exceptionsRtcrypto_sign_bytesRtcrypto_sign_secretkeybytesRtcrypto_sign_publickeybytesR	R
tcrypto_box_secretkeybytesRt crypto_sign_ed25519ph_statebytesR*RRRRR R$tobjectR(R5R9R<(((s;/tmp/pip-install-A1qMVe/pynacl/nacl/bindings/crypto_sign.pyt<module>s&								$

https://t.me/AnonymousX5 - 2025