aboutsummaryrefslogtreecommitdiff
path: root/verilog_constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'verilog_constants.h')
-rw-r--r--verilog_constants.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/verilog_constants.h b/verilog_constants.h
index 8735b12..db75294 100644
--- a/verilog_constants.h
+++ b/verilog_constants.h
@@ -9,6 +9,8 @@
*
* Authors: Joachim Strombergson, Paul Selkirk, Rob Austein
* Copyright (c) 2015-2017, NORDUnet A/S All rights reserved.
+ * Copyright: 2020, The Commons Conservancy Cryptech Project
+ * SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -20,9 +22,9 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * - Neither the name of the NORDUnet nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * - Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -257,6 +259,48 @@
#define MODEXPA7_MODE_PLAIN (0 << 1)
/*
+ * ModExpNG core
+ */
+#define MODEXPNG_OPERAND_BITS (4096)
+#define MODEXPNG_OPERAND_BYTES (MODEXPNG_OPERAND_BITS / 8)
+#define MODEXPNG_OPERAND_WORDS (MODEXPNG_OPERAND_BITS / 32)
+#define MODEXPNG_ADDR_NAME0 ADDR_NAME0
+#define MODEXPNG_ADDR_NAME1 ADDR_NAME1
+#define MODEXPNG_ADDR_VERSION ADDR_VERSION
+#define MODEXPNG_ADDR_CONTROL ADDR_CTRL
+#define MODEXPNG_ADDR_STATUS ADDR_STATUS
+#define MODEXPNG_ADDR_MODE (0x10)
+#define MODEXPNG_ADDR_MODULUS_BITS (0x11)
+#define MODEXPNG_ADDR_EXPONENT_BITS (0x12)
+#define MODEXPNG_ADDR_BANK_BITS (0x13)
+#define MODEXPNG_ADDR_NUM_MULTS (0x14)
+
+#define MODEXPNG_ADDR_BANK_M (1 * 0x400 + 0 * 0x80)
+#define MODEXPNG_ADDR_BANK_N (1 * 0x400 + 1 * 0x80)
+#define MODEXPNG_ADDR_BANK_N_FACTOR (1 * 0x400 + 2 * 0x80)
+#define MODEXPNG_ADDR_BANK_N_COEFF (1 * 0x400 + 3 * 0x80)
+#define MODEXPNG_ADDR_BANK_X (1 * 0x400 + 5 * 0x80)
+#define MODEXPNG_ADDR_BANK_Y (1 * 0x400 + 6 * 0x80)
+
+#define MODEXPNG_ADDR_BANK_D (2 * 0x400 + 0 * 0x80)
+#define MODEXPNG_ADDR_BANK_P (2 * 0x400 + 1 * 0x80)
+#define MODEXPNG_ADDR_BANK_DP (2 * 0x400 + 3 * 0x40)
+#define MODEXPNG_ADDR_BANK_P_FACTOR (2 * 0x400 + 2 * 0x80)
+#define MODEXPNG_ADDR_BANK_P_COEFF (2 * 0x400 + 3 * 0x80)
+#define MODEXPNG_ADDR_BANK_Q (2 * 0x400 + 4 * 0x80)
+#define MODEXPNG_ADDR_BANK_DQ (2 * 0x400 + 9 * 0x40)
+#define MODEXPNG_ADDR_BANK_Q_FACTOR (2 * 0x400 + 5 * 0x80)
+#define MODEXPNG_ADDR_BANK_Q_COEFF (2 * 0x400 + 6 * 0x80)
+#define MODEXPNG_ADDR_BANK_QINV (2 * 0x400 + 7 * 0x80)
+
+#define MODEXPNG_ADDR_BANK_S (3 * 0x400 + 0 * 0x80)
+#define MODEXPNG_ADDR_BANK_XM (3 * 0x400 + 1 * 0x80)
+#define MODEXPNG_ADDR_BANK_YM (3 * 0x400 + 2 * 0x80)
+
+#define MODEXPNG_MODE_CRT (1 << 1)
+#define MODEXPNG_MODE_PLAIN (0 << 1)
+
+/*
* ECDSA P-256 point multiplier core. ECDSA256_OPERAND_BITS is size
* in bits of the (only) supported operand size (256 bits, imagine that).
*