Skip to content

Commit

Permalink
Merge pull request #8 from YoilyL/tests
Browse files Browse the repository at this point in the history
Released the GIL
  • Loading branch information
delivrance committed Jun 14, 2019
2 parents 690cda0 + 2290f41 commit aabb77d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tgcrypto/tgcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ static PyObject *ige(PyObject *args, uint8_t encrypt) {
return NULL;
}

Py_BEGIN_ALLOW_THREADS
buf = ige256(data.buf, data.len, key.buf, iv.buf, encrypt);
Py_END_ALLOW_THREADS

PyBuffer_Release(&data);
PyBuffer_Release(&key);
Expand Down Expand Up @@ -104,7 +106,9 @@ static PyObject *ctr256_encrypt(PyObject *self, PyObject *args) {
return NULL;
}

Py_BEGIN_ALLOW_THREADS
buf = ctr256(data.buf, data.len, key.buf, iv.buf, state.buf);
Py_END_ALLOW_THREADS

PyBuffer_Release(&data);
PyBuffer_Release(&key);
Expand Down Expand Up @@ -144,7 +148,9 @@ static PyObject *cbc(PyObject *args, uint8_t encrypt) {
return NULL;
}

Py_BEGIN_ALLOW_THREADS
buf = cbc256(data.buf, data.len, key.buf, iv.buf, encrypt);
Py_END_ALLOW_THREADS

PyBuffer_Release(&data);
PyBuffer_Release(&key);
Expand Down

0 comments on commit aabb77d

Please sign in to comment.