aboutsummaryrefslogtreecommitdiffstats
path: root/libkeccak.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-26 14:09:49 +0100
committerMattias Andrée <maandree@kth.se>2022-02-26 19:11:06 +0100
commite2d8ba51ecd9a302641e63bf7aafbcddb8da1375 (patch)
tree49f027a6f62f46269fe43095c1197d97600a554a /libkeccak.h
parentFix error in libkeccak_degeneralise_spec: spec->state_size was set to 1 rather than have_state_size (diff)
downloadlibkeccak-e2d8ba51ecd9a302641e63bf7aafbcddb8da1375.tar.gz
libkeccak-e2d8ba51ecd9a302641e63bf7aafbcddb8da1375.tar.bz2
libkeccak-e2d8ba51ecd9a302641e63bf7aafbcddb8da1375.tar.xz
Fix libkeccak_degeneralise_spec and add missing error: LIBKECCAK_GENERALISED_SPEC_ERROR_STATE_BITRATE_CAPACITY_INCONSISTENCY
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libkeccak.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libkeccak.h b/libkeccak.h
index 1244aec..932c5de 100644
--- a/libkeccak.h
+++ b/libkeccak.h
@@ -160,6 +160,14 @@
*/
#define LIBKECCAK_GENERALISED_SPEC_ERROR_OUTPUT_NONPOSITIVE 11
+/**
+ * Invalid `struct libkeccak_generalised_spec.state_size`,
+ * `struct libkeccak_generalised_spec.bitrate`, and
+ * `struct libkeccak_generalised_spec.capacity`:
+ * `.bitrate + .capacity != .state_size`
+ */
+#define LIBKECCAK_GENERALISED_SPEC_ERROR_STATE_BITRATE_CAPACITY_INCONSISTENCY 12
+
/**
* Data structure that describes the parameters
@@ -313,7 +321,7 @@ libkeccak_spec_rawshake(struct libkeccak_spec *spec, long int x, long int d)
}
/**
- * Fill in a `struct libkeccak_spec` for a SHAKEx hashing
+< * Fill in a `struct libkeccak_spec` for a SHAKEx hashing
*
* @param spec:struct libkeccak_spec * The specifications datastructure to fill in
* @param x:long The value of x in `SHAKEx`, half the capacity