Ejemplo n.º 1
0
def crypto_scalarmult_base(n):
    """
    Computes and returns the scalar product of a standard group element and an
    integer ``n``.

    :param n: bytes
    :rtype: bytes
    """
    q = lib.ffi.new("unsigned char[]", crypto_scalarmult_BYTES)

    rc = lib.crypto_scalarmult_base(q, n)
    assert rc == 0

    return lib.ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:]
Ejemplo n.º 2
0
def crypto_scalarmult_base(n):
    """
    Computes and returns the scalar product of a standard group element and an
    integer ``n``.

    :param n: bytes
    :rtype: bytes
    """
    q = lib.ffi.new("unsigned char[]", crypto_scalarmult_BYTES)

    rc = lib.crypto_scalarmult_base(q, n)
    assert rc == 0

    return lib.ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:]
Ejemplo n.º 3
0
def crypto_scalarmult_base(n):
    """
    Computes and returns the scalar product of a standard group element and an
    integer ``n``.

    :param n: bytes
    :rtype: bytes
    """
    q = lib.ffi.new("unsigned char[]", crypto_scalarmult_BYTES)

    if lib.crypto_scalarmult_base(q, n) != 0:
        raise CryptoError(
            "An error occurred while computing the scalar product")

    return lib.ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:]
Ejemplo n.º 4
0
def crypto_scalarmult_base(n):
    """
    Computes and returns the scalar product of a standard group element and an
    integer ``n``.

    :param n: bytes
    :rtype: bytes
    """
    q = lib.ffi.new("unsigned char[]", crypto_scalarmult_BYTES)

    if lib.crypto_scalarmult_base(q, n) != 0:
        raise CryptoError(
            "An error occurred while computing the scalar product")

    return lib.ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:]