%PDF- %PDF-
| Direktori : /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/ |
| Current File : //opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyo |
�
�֫[c @` s d d l m Z m Z m Z d d l m Z d d l m Z m Z d d l
m Z e j � Z
e j � d Z e j � Z e j � Z e j � Z e j � Z d � Z d � Z d � Z d � Z d
� Z d � Z d e f d
� � YZ d � Z d � Z d � Z! d S( i ( t absolute_importt divisiont print_function( t
exceptions( t ffit lib( t ensurei c C` sv t j d t � } t j d t � } t j | | � } t | d k d d t j �t j | t � t j | t � f S( Ns unsigned char[]i s Unexpected library errort raising(
R t newt crypto_sign_PUBLICKEYBYTESt crypto_sign_SECRETKEYBYTESR t crypto_sign_keypairR t exct RuntimeErrort buffer( t pkt skt rc( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR ! s
c C` s� t | � t k r$ t j d � � n t j d t � } t j d t � } t j | | | � } t
| d k d d t j �t j | t � t j | t � f S( Ns Invalid seeds unsigned char[]i s Unexpected library errorR (
t lent crypto_sign_SEEDBYTESR t
ValueErrorR R R R
R t crypto_sign_seed_keypairR R
R ( t seedR R R ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR 5 s
c C` s} t j d t | � t � } t j d � } t j | | | t | � | � } t | d k d d t j �t j | | d � S( Ns unsigned char[]s unsigned long long *i s Unexpected library errorR (
R R R t crypto_sign_BYTESR t crypto_signR R R
R ( t messageR t signedt
signed_lenR ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR M s !
c C` su t j d t | � � } t j d � } t j | | | t | � | � d k r` t j d � � n t j | | d � S( Ns unsigned char[]s unsigned long long *i s Signature was forged or corrupt( R R R R t crypto_sign_openR t BadSignatureErrorR ( R R R t message_len( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR a s !c C` s{ t | � t k r$ t j d � � n t } t j d | � } t j | | � } t | d k d d t j
�t j | | � S( Ns Invalid curve public keys unsigned char[]i s Unexpected library errorR ( R R R R t crypto_sign_curve25519_BYTESR R R t$ crypto_sign_ed25519_pk_to_curve25519R R
R ( t public_key_bytest curve_public_key_lent curve_public_keyR ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR t s
c C` s{ t | � t k r$ t j d � � n t } t j d | � } t j | | � } t | d k d d t j
�t j | | � S( Ns Invalid curve public keys unsigned char[]i s Unexpected library errorR ( R R
R R R R R R t$ crypto_sign_ed25519_sk_to_curve25519R R
R ( t secret_key_bytest curve_secret_key_lent curve_secret_keyR ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR$ � s
t crypto_sign_ed25519ph_statec B` s e Z d g Z d � Z RS( t statec C` sG t j d t � | _ t j | j � } t | d k d d t j �d S( Ns unsigned char[]i s Unexpected library errorR ( R R t crypto_sign_ed25519ph_STATEBYTESR) R t crypto_sign_ed25519ph_initR R R
( t selfR ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyt __init__� s ( t __name__t
__module__t __slots__R- ( ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR( � s c C` s| t t | t � d d t j �t t | t � d d t j �t j | j | t | � � } t | d k d d t j
�d S( Ns/ edph parameter must be a ed25519ph_state objectR s% pmsg parameter must be a bytes objecti s Unexpected library error( R t
isinstanceR( R t TypeErrort bytesR t crypto_sign_ed25519ph_updateR) R R
( t edpht pmsgR ( ( sP /opt/plesk/python/2.7/lib64/python2.7/site-packages/nacl/bindings/crypto_sign.pyR4 � s
c C` s� t t | t � d d t j �t t | t � d d t j �t t | � t k d j t � d t j �t j
d t � } t j
| j | t j | � } t | d k d d t j �t j | t � S( Ns/ edph parameter must be a ed25519ph_state objectR s+ secret key parameter must be a bytes objects! secret key must be {0} bytes longs unsigned char[]i s Unexpected library error( R R1 R( R R2 R3 R R
t formatR R R R t"