diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-10 17:35:41 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-12 14:49:02 -0400 |
commit | 5bdf4469b9bf68086fe11b73f9372aae4558b529 (patch) | |
tree | c7ac05489b1523bb41c342be050485030c73c29c /src/_counter.h | |
parent | 10b882261ae4022792c9f5e39d242d07ab769a5c (diff) | |
download | pycrypto-5bdf4469b9bf68086fe11b73f9372aae4558b529.tar.gz |
Counter: raise OverflowError by default when the counter wraps around.
The old behaviour can be obtained by explicitly setting allow_wraparound=True
when invoking Counter.new
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 9735aab..faaf63f 100644 --- a/src/_counter.h +++ b/src/_counter.h @@ -38,6 +38,7 @@ typedef struct { void (*inc_func)(void *); /* Pointer to the counter increment function */ 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 */ } PCT_CounterObject; #endif /* PCT__COUNTER_H */ |