summaryrefslogtreecommitdiffstats
path: root/xmss_hash_address.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:26:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:26:58 +0000
commit999ae6be3243c7b4a815247199447b53c39a3d65 (patch)
tree1f35b42b5e5f462d35ba452e4dcfa188ce0543fd /xmss_hash_address.c
parentInitial commit. (diff)
downloadopenssh-999ae6be3243c7b4a815247199447b53c39a3d65.tar.xz
openssh-999ae6be3243c7b4a815247199447b53c39a3d65.zip
Adding upstream version 1:7.9p1.upstream/1%7.9p1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xmss_hash_address.c')
-rw-r--r--xmss_hash_address.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/xmss_hash_address.c b/xmss_hash_address.c
new file mode 100644
index 0000000..c6c1347
--- /dev/null
+++ b/xmss_hash_address.c
@@ -0,0 +1,66 @@
+/* $OpenBSD: xmss_hash_address.c,v 1.2 2018/02/26 03:56:44 dtucker Exp $ */
+/*
+hash_address.c version 20160722
+Andreas Hülsing
+Joost Rijneveld
+Public domain.
+*/
+#include "includes.h"
+#ifdef WITH_XMSS
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include "xmss_hash_address.h" /* prototypes */
+
+void setLayerADRS(uint32_t adrs[8], uint32_t layer){
+ adrs[0] = layer;
+}
+
+void setTreeADRS(uint32_t adrs[8], uint64_t tree){
+ adrs[1] = (uint32_t) (tree >> 32);
+ adrs[2] = (uint32_t) tree;
+}
+
+void setType(uint32_t adrs[8], uint32_t type){
+ adrs[3] = type;
+ int i;
+ for(i = 4; i < 8; i++){
+ adrs[i] = 0;
+ }
+}
+
+void setKeyAndMask(uint32_t adrs[8], uint32_t keyAndMask){
+ adrs[7] = keyAndMask;
+}
+
+// OTS
+
+void setOTSADRS(uint32_t adrs[8], uint32_t ots){
+ adrs[4] = ots;
+}
+
+void setChainADRS(uint32_t adrs[8], uint32_t chain){
+ adrs[5] = chain;
+}
+
+void setHashADRS(uint32_t adrs[8], uint32_t hash){
+ adrs[6] = hash;
+}
+
+// L-tree
+
+void setLtreeADRS(uint32_t adrs[8], uint32_t ltree){
+ adrs[4] = ltree;
+}
+
+// Hash Tree & L-tree
+
+void setTreeHeight(uint32_t adrs[8], uint32_t treeHeight){
+ adrs[5] = treeHeight;
+}
+
+void setTreeIndex(uint32_t adrs[8], uint32_t treeIndex){
+ adrs[6] = treeIndex;
+}
+#endif /* WITH_XMSS */