aboutsummaryrefslogtreecommitdiff
path: root/verilog_constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'verilog_constants.h')
-rw-r--r--verilog_constants.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/verilog_constants.h b/verilog_constants.h
index 1b00b96..f92adaa 100644
--- a/verilog_constants.h
+++ b/verilog_constants.h
@@ -256,6 +256,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).
*