diff options
author | Rob Austein <sra@hactrn.net> | 2015-09-08 12:45:01 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-09-08 12:45:01 -0400 |
commit | c334ad5442340a6f6ba22d3d56970b7fe376df6b (patch) | |
tree | dafab59be410e976cd64e14236d0130fe5b6e779 /hal.h | |
parent | 53bff0b94832da75e37bea3e94e051f24fdec560 (diff) | |
parent | 2d37968bdcfb97281386ca56cea59d39c0b98f8b (diff) |
Merge branch 'modexps6'
Diffstat (limited to 'hal.h')
-rw-r--r-- | hal.h | 56 |
1 files changed, 25 insertions, 31 deletions
@@ -390,39 +390,33 @@ * MATH segment. */ -/* Modexp core */ -#define MODEXP_ADDR_BASE (SEGMENT_OFFSET_MATH + (0x00 * CORE_SIZE)) -#define MODEXP_ADDR_NAME0 (MODEXP_ADDR_BASE + ADDR_NAME0) -#define MODEXP_ADDR_NAME1 (MODEXP_ADDR_BASE + ADDR_NAME1) -#define MODEXP_ADDR_VERSION (MODEXP_ADDR_BASE + ADDR_VERSION) -#define MODEXP_ADDR_CTRL (MODEXP_ADDR_BASE + ADDR_CTRL) -#define MODEXP_CTRL_INIT_BIT (1) -#define MODEXP_CTRL_NEXT_BIT (2) -#define MODEXP_ADDR_STATUS (MODEXP_ADDR_BASE + ADDR_STATUS) +#define MATH_CORE_SIZE (0x400) -#define MODEXP_ADDR_DELAY (MODEXP_ADDR_BASE + 0x13) -#define MODEXP_STATUS_READY (1) - -#define MODEXP_MODULUS_LENGTH (MODEXP_ADDR_BASE + 0x20) -#define MODEXP_EXPONENT_LENGTH (MODEXP_ADDR_BASE + 0x21) -#define MODEXP_LENGTH (MODEXP_ADDR_BASE + 0x22) - -#define MODEXP_MODULUS_PTR_RST (MODEXP_ADDR_BASE + 0x30) -#define MODEXP_MODULUS_DATA (MODEXP_ADDR_BASE + 0x31) - -#define MODEXP_EXPONENT_PTR_RST (MODEXP_ADDR_BASE + 0x40) -#define MODEXP_EXPONENT_DATA (MODEXP_ADDR_BASE + 0x41) - -#define MODEXP_MESSAGE_PTR_RST (MODEXP_ADDR_BASE + 0x50) -#define MODEXP_MESSAGE_DATA (MODEXP_ADDR_BASE + 0x51) - -#define MODEXP_RESULT_PTR_RST (MODEXP_ADDR_BASE + 0x60) -#define MODEXP_RESULT_DATA (MODEXP_ADDR_BASE + 0x61) - -#define MODEXP_NAME0 "mode" -#define MODEXP_NAME1 "xp " -#define MODEXP_VERSION "0.51" +/* + * ModExpS6 core. MODEXPS6_OPERAND_BITS is size in bits of largest + * supported modulus. + */ +#define MODEXPS6_ADDR_BASE (SEGMENT_OFFSET_MATH + (0x00 * MATH_CORE_SIZE)) +#define MODEXPS6_OPERAND_BITS (4096) +#define MODEXPS6_OPERAND_WORDS (MODEXPS6_OPERAND_BITS/32) +#define MODEXPS6_ADDR_REGISTERS (MODEXPS6_ADDR_BASE + 0*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_ADDR_OPERANDS (MODEXPS6_ADDR_BASE + 4*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_ADDR_NAME0 (MODEXPS6_ADDR_REGISTERS + ADDR_NAME0) +#define MODEXPS6_ADDR_NAME1 (MODEXPS6_ADDR_REGISTERS + ADDR_NAME1) +#define MODEXPS6_ADDR_VERSION (MODEXPS6_ADDR_REGISTERS + ADDR_VERSION) +#define MODEXPS6_ADDR_CTRL (MODEXPS6_ADDR_REGISTERS + ADDR_CTRL) +#define MODEXPS6_ADDR_STATUS (MODEXPS6_ADDR_REGISTERS + ADDR_STATUS) +#define MODEXPS6_ADDR_MODE (MODEXPS6_ADDR_REGISTERS + 0x10) +#define MODEXPS6_ADDR_MODULUS_WIDTH (MODEXPS6_ADDR_REGISTERS + 0x11) +#define MODEXPS6_ADDR_EXPONENT_WIDTH (MODEXPS6_ADDR_REGISTERS + 0x12) +#define MODEXPS6_ADDR_MODULUS (MODEXPS6_ADDR_OPERANDS + 0*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_ADDR_MESSAGE (MODEXPS6_ADDR_OPERANDS + 1*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_ADDR_EXPONENT (MODEXPS6_ADDR_OPERANDS + 2*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_ADDR_RESULT (MODEXPS6_ADDR_OPERANDS + 3*MODEXPS6_OPERAND_WORDS) +#define MODEXPS6_NAME0 "mode" +#define MODEXPS6_NAME1 "xps6" +#define MODEXPS6_VERSION "0.10" /* * C API error codes. Defined in this form so we can keep the tokens |