aboutsummaryrefslogtreecommitdiffstats
path: root/python3/sha3sum.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-17 00:42:07 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-17 00:42:07 +0200
commit938aa55a95fda70b403fa5cabb43c6cc37292ebf (patch)
treef77e74b2f02b38e35997182984ce2a05aeb146f3 /python3/sha3sum.py
parentm + fix for python version (diff)
downloadsha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.gz
sha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.bz2
sha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.xz
change defaults (conflicts with Wikipedia but is based on official Keccak defaults; no defaults have yet been standardised)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'python3/sha3sum.py')
-rwxr-xr-xpython3/sha3sum.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python3/sha3sum.py b/python3/sha3sum.py
index ebb4c98..d388f1f 100755
--- a/python3/sha3sum.py
+++ b/python3/sha3sum.py
@@ -655,8 +655,8 @@ if __name__ == '__main__':
elif cmd == 'sha3-384sum': _o = 384
elif cmd == 'sha3-512sum': _o = 512
_s = 1600 # --statesize
- _r = _s - (_o << 1) # --bitrate
- _c = _s - _r # --capacity
+ _c = _s - (_o << 1) # --capacity
+ _r = _s - _c # --bitrate
_w = _s / 25 # --wordsize
_i = 1 # --iterations
_j = 1 # --squeezes
@@ -834,8 +834,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
if (R is None) and (C is None) and (O is None): ## s?
s = _s if S is None else s
o = (((s << 5) // 100 + 7) >> 3) << 3
- c = o << 1
- r = s - c
+ r = o << 1
+ c = s - r
o = 8 if o < 8 else o
elif (R is None) and (C is None): ## !o s?
r = _r