a °…b4 ã@sÚUddlmZddlmZmZddlmZeej ƒZ e  ¡Z e ed<e ¡Ze ed<dZdZe rpe ¡Ze ¡Zeedœdd„Zeeed œd d „Zeedœd d „Zeedœdd„Zeeed œdd„Zeeed œdd„ZdS)é)Ú exceptions)ÚffiÚlib)ÚensureÚcrypto_scalarmult_BYTESÚcrypto_scalarmult_SCALARBYTES)ÚnÚreturncCs@t dt¡}t ||¡}t|dkdtjdt |t ¡dd…S)zŽ Computes and returns the scalar product of a standard group element and an integer ``n``. :param n: bytes :rtype: bytes úunsigned char[]rúUnexpected library error©ZraisingN) rÚnewrrÚcrypto_scalarmult_baserÚexcÚ RuntimeErrorÚbufferr©rÚqÚrc©rúF/tmp/pip-target-98j97qn4/lib/python/nacl/bindings/crypto_scalarmult.pyr$s  r)rÚpr cCsBt dt¡}t |||¡}t|dkdtjdt |t ¡dd…S)z¡ Computes and returns the scalar product of the given group element and an integer ``n``. :param p: bytes :param n: bytes :rtype: bytes r rr r N) rr rrÚcrypto_scalarmultrrrrr©rrrrrrrr4s rcCsxttdtjdtt|tƒo&t|ƒtkd d¡tj dt   dt ¡}t  ||¡}t|dkdtjdt  |t ¡dd…S) a Computes and returns the scalar product of a standard group element and an integer ``n`` on the edwards25519 curve. :param n: a :py:data:`.crypto_scalarmult_ed25519_SCALARBYTES` long bytes sequence representing a scalar :type n: bytes :return: a point on the edwards25519 curve, represented as a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence :rtype: bytes :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. úNot available in minimal buildr ú&Input must be a {} long bytes sequenceÚ%crypto_scalarmult_ed25519_SCALARBYTESr rr N)rÚhas_crypto_scalarmult_ed25519rÚUnavailableErrorÚ isinstanceÚbytesÚlenrÚformatÚ TypeErrorrr Úcrypto_scalarmult_ed25519_BYTESrÚcrypto_scalarmult_ed25519_baserrrrrrr%Es"ý  ÿú  r%cCsxttdtjdtt|tƒo&t|ƒtkd d¡tj dt   dt ¡}t  ||¡}t|dkdtjdt  |t ¡dd…S) a: Computes and returns the scalar product of a standard group element and an integer ``n`` on the edwards25519 curve. The integer ``n`` is not clamped. :param n: a :py:data:`.crypto_scalarmult_ed25519_SCALARBYTES` long bytes sequence representing a scalar :type n: bytes :return: a point on the edwards25519 curve, represented as a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence :rtype: bytes :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. rr rrr rr N)rrrrrr r!rr"r#rr r$rÚ&crypto_scalarmult_ed25519_base_noclamprrrrrrr&js"ý  ÿú  r&cCs¢ttdtjdtt|tƒo&t|ƒtkd d¡tj dtt|tƒoNt|ƒt kd d¡tj dt   dt ¡}t  |||¡}t|dkdtjdt  |t ¡d d …S) aq Computes and returns the scalar product of a *clamped* integer ``n`` and the given group element on the edwards25519 curve. The scalar is clamped, as done in the public key generation case, by setting to zero the bits in position [0, 1, 2, 255] and setting to one the bit in position 254. :param n: a :py:data:`.crypto_scalarmult_ed25519_SCALARBYTES` long bytes sequence representing a scalar :type n: bytes :param p: a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence representing a point on the edwards25519 curve :type p: bytes :return: a point on the edwards25519 curve, represented as a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence :rtype: bytes :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. rr rrr$r rr N)rrrrrr r!rr"r#r$rr rÚcrypto_scalarmult_ed25519rrrrrrr's0ý  ÿú ÿû r'cCs¢ttdtjdtt|tƒo&t|ƒtkd d¡tj dtt|tƒoNt|ƒt kd d¡tj dt   dt ¡}t  |||¡}t|dkdtjdt  |t ¡d d …S) aÝ Computes and returns the scalar product of an integer ``n`` and the given group element on the edwards25519 curve. The integer ``n`` is not clamped. :param n: a :py:data:`.crypto_scalarmult_ed25519_SCALARBYTES` long bytes sequence representing a scalar :type n: bytes :param p: a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence representing a point on the edwards25519 curve :type p: bytes :return: a point on the edwards25519 curve, represented as a :py:data:`.crypto_scalarmult_ed25519_BYTES` long bytes sequence :rtype: bytes :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. rr rrr$r rr N)rrrrrr r!rr"r#r$rr rÚ!crypto_scalarmult_ed25519_noclamprrrrrrr(Âs0ý  ÿú ÿû r(N)ZnaclrrZ nacl._sodiumrrZnacl.exceptionsrÚboolZ$PYNACL_HAS_CRYPTO_SCALARMULT_ED25519rZcrypto_scalarmult_bytesrÚintÚ__annotations__Zcrypto_scalarmult_scalarbytesrr$rZcrypto_scalarmult_ed25519_bytesZ%crypto_scalarmult_ed25519_scalarbytesr rrr%r&r'r(rrrrÚs"  ÿ%%3