Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(54459)

Delta Between Two Patch Sets: Modules/hashlib.h

Issue 26798: add BLAKE2 to hashlib
Left Patch Set: Created 3 years, 5 months ago
Right Patch Set: Created 3 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Modules/_blake2/impl/blake2s-round.h ('k') | PCbuild/pythoncore.vcxproj » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* Common code for use by all hashlib related modules. */ 1 /* Common code for use by all hashlib related modules. */
2 2
3 /* 3 /*
4 * Given a PyObject* obj, fill in the Py_buffer* viewp with the result 4 * Given a PyObject* obj, fill in the Py_buffer* viewp with the result
5 * of PyObject_GetBuffer. Sets an exception and issues a return NULL 5 * of PyObject_GetBuffer. Sets an exception and issues the erraction
6 * on any errors. 6 * on any errors, e.g. 'return NULL' or 'goto error'.
7 */ 7 */
8 #define GET_BUFFER_VIEW_OR_ERROR(obj, viewp, erraction) do { \ 8 #define GET_BUFFER_VIEW_OR_ERROR(obj, viewp, erraction) do { \
9 if (PyUnicode_Check((obj))) { \ 9 if (PyUnicode_Check((obj))) { \
10 PyErr_SetString(PyExc_TypeError, \ 10 PyErr_SetString(PyExc_TypeError, \
11 "Unicode-objects must be encoded before hashing");\ 11 "Unicode-objects must be encoded before hashing");\
12 erraction; \ 12 erraction; \
13 } \ 13 } \
14 if (!PyObject_CheckBuffer((obj))) { \ 14 if (!PyObject_CheckBuffer((obj))) { \
15 PyErr_SetString(PyExc_TypeError, \ 15 PyErr_SetString(PyExc_TypeError, \
16 "object supporting the buffer API required"); \ 16 "object supporting the buffer API required"); \
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 #else 56 #else
57 #define ENTER_HASHLIB(obj) 57 #define ENTER_HASHLIB(obj)
58 #define LEAVE_HASHLIB(obj) 58 #define LEAVE_HASHLIB(obj)
59 #endif 59 #endif
60 60
61 /* TODO(gps): We should probably make this a module or EVPobject attribute 61 /* TODO(gps): We should probably make this a module or EVPobject attribute
62 * to allow the user to optimize based on the platform they're using. */ 62 * to allow the user to optimize based on the platform they're using. */
63 #define HASHLIB_GIL_MINSIZE 2048 63 #define HASHLIB_GIL_MINSIZE 2048
64 64
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+