def encrypt(key, msg, iv=None, alg="aes_128_cbc", padding="PKCS#7",
            b64enc=True, block_size=BLOCK_SIZE):

    if padding == "PKCS#7":
        _block_size = block_size
    elif padding == "PKCS#5":
        _block_size = 8
    else:
        _block_size = 0

    if _block_size:
        plen = _block_size - (len(msg) % _block_size)
        c = chr(plen)
        msg += (c * plen)

    cipher, iv = build_cipher(tobytes(key), iv, alg)
    cmsg = iv + cipher.encrypt(tobytes(msg))
    if b64enc:
        return b64encode(cmsg)
    else:
        return cmsg
Transpose of real general matrix.
dataset/ETHPy150Open rohe/pyoidc/src/oic/utils/aes.py/encrypt--crossover with--dataset/ETHPy150Open lebedov/scikit-cuda/skcuda/cula.py/culaDeviceSgeTranspose