diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-10 18:13:05 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-12 14:53:58 -0400 |
commit | 3d4d4909fb3625ae8746d1b61776b82a0d791150 (patch) | |
tree | 39cf7fd2f881791a3e3bd435ee7bf30f832d6095 /src/_counter.h | |
parent | bfee094ad23cb2406eedc1bbee6c498f40353695 (diff) | |
download | pycrypto-3d4d4909fb3625ae8746d1b61776b82a0d791150.tar.gz |
Check for counter wraparound when encrypting using MODE_CTR
- Add check_wraparound_func pointer to PCT_CounterObject
- Call check_wraparound_func from block_template.c
Diffstat (limited to 'src/_counter.h')
-rw-r--r-- | src/_counter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/_counter.h b/src/_counter.h index faaf63f..af401cd 100644 --- a/src/_counter.h +++ b/src/_counter.h @@ -39,6 +39,7 @@ typedef struct { int shortcut_disabled; /* This gets set to a non-zero value when the shortcut mechanism is disabled */ int carry; /* This gets set by Counter*Object_increment when the counter wraps around */ int allow_wraparound; /* When this is false, we raise OverflowError on next_value() or __call__() when the counter wraps around */ + int (*check_wraparound_func)(void *); /* Pointer to the functon that checks for overflow. Returns zero and sets OverflowError if the check fails. */ } PCT_CounterObject; #endif /* PCT__COUNTER_H */ |