When allocating a crypto_digest_t, allocate no more bytes than needed

Previously we would allocate as many bytes as we'd need for a
keccak--even when we were only calculating SHA1.

Closes ticket 17796.
This commit is contained in:
Nick Mathewson
2015-12-20 15:15:11 -05:00
parent bb19799a49
commit 488cdee5e7
2 changed files with 58 additions and 20 deletions
+6
View File
@@ -0,0 +1,6 @@
o Minor features (crypto):
- When allocating a digest state object, allocate no more space than we
actually need. Previously, we were allocating as much space as the
state for the largest algorithm would need. This change saves up to
672 bytes per circuit. Closes ticket 17796.