aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-19 11:04:13 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-19 11:04:13 -0800
commit769073b7d3a9cc397eb916bda00bb34eb5cbd130 (patch)
tree69907d4802c576724f20fc0c3db338a77aa6d065
parentfa1b5bf92e7429c03811050cb2b4b316808da70f (diff)
downloadcryptography-769073b7d3a9cc397eb916bda00bb34eb5cbd130.tar.gz
cryptography-769073b7d3a9cc397eb916bda00bb34eb5cbd130.tar.bz2
cryptography-769073b7d3a9cc397eb916bda00bb34eb5cbd130.zip
name this function correcctly
-rw-r--r--cryptography/hazmat/primitives/padding.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cryptography/hazmat/primitives/padding.py b/cryptography/hazmat/primitives/padding.py
index 6e583b24..6849d149 100644
--- a/cryptography/hazmat/primitives/padding.py
+++ b/cryptography/hazmat/primitives/padding.py
@@ -20,7 +20,7 @@ from cryptography.hazmat.primitives import interfaces
_ffi = cffi.FFI()
_ffi.cdef("""
-bool Cryptography_check_padding(const uint8_t *, uint8_t);
+bool Cryptography_check_pkcs7_padding(const uint8_t *, uint8_t);
""")
_lib = _ffi.verify("""
#include <stdbool.h>
@@ -38,7 +38,7 @@ static uint8_t Cryptography_constant_time_lt(uint8_t a, uint8_t b) {
return Cryptography_DUPLICATE_MSB_TO_ALL(a);
}
-bool Cryptography_check_padding(const uint8_t *data, uint8_t block_len) {
+bool Cryptography_check_pkcs7_padding(const uint8_t *data, uint8_t block_len) {
uint8_t i;
uint8_t pad_size = data[block_len - 1];
uint8_t mismatch = 0;
@@ -150,7 +150,7 @@ class _PKCS7UnpaddingContext(object):
if len(self._buffer) != self.block_size // 8:
raise ValueError("Invalid padding bytes")
- valid = _lib.Cryptography_check_padding(
+ valid = _lib.Cryptography_check_pkcs7_padding(
self._buffer, self.block_size // 8
)