diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-31 16:25:25 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-31 16:25:25 -0700 |
commit | 38db2140e270c19d781aa35c5aa098a107179141 (patch) | |
tree | 5e49d9921f6548421ec4adecc5d70b6312e9574a | |
parent | 6b9770b159b920cccddc8e3c3d1b0fb0287a0c15 (diff) | |
download | cryptography-38db2140e270c19d781aa35c5aa098a107179141.tar.gz cryptography-38db2140e270c19d781aa35c5aa098a107179141.tar.bz2 cryptography-38db2140e270c19d781aa35c5aa098a107179141.zip |
Be C99
-rw-r--r-- | cryptography/fernet.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cryptography/fernet.py b/cryptography/fernet.py index 214b9374..10640d1b 100644 --- a/cryptography/fernet.py +++ b/cryptography/fernet.py @@ -25,11 +25,12 @@ lib = ffi.verify(""" #include <stdbool.h> bool constant_time_compare(uint8_t *a, size_t len_a, uint8_t *b, size_t len_b) { + size_t i = 0; + int result = 0; if (len_a != len_b) { return false; } - int result = 0; - for (size_t i = 0; i < len_a; i++) { + for (i = 0; i < len_a; i++) { result |= a[i] ^ b[i]; } return result == 0; |