Bug 786 - Implement gfp* instructions for GF(p) instructions
Summary: Implement gfp* instructions for GF(p) instructions
Status: CONFIRMED
Alias: None
Product: Libre-SOC's second ASIC
Classification: Unclassified
Component: source code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Jacob Lifshay
URL:
Depends on: 787
Blocks: 782
  Show dependency treegraph
 
Reported: 2022-03-21 03:15 GMT by Jacob Lifshay
Modified: 2022-03-21 04:50 GMT (History)
2 users (show)

See Also:
NLnet milestone: NLnet.2021.02A.052.CryptoRouter
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation: 782
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Lifshay 2022-03-21 03:15:37 GMT
First: TODO: decide if we want to implement these.

TODO: decide if we want to limit ourselves to GF(p) for prime p or change these instructions to work for all modular arithmetic (modulus isn't required to be prime). If we want the instructions to work for all modular arithmetic, then they should probably be named mod* rather than gfp*.

Instructions:
* gfpadd, gfpsub
* gfpmul
* gfpinv (decide what div by 0 does -- decide what non-invertable inputs do (only happens for composite moduli))
* gcd (maybe -- other output of gfpinv's algorithm, we have the hardware, why not use it?)
* gfpmadd, gfpmsub, gfpmsubr (sub reversed)
* gfpmaddsubr (for fft)

Steps (edit as needed):
* TODO: Instruction Encodings
* basic adaptable modules (probably in nmigen-gf)
  * TODO: module in nmigen-gf
  * TODO: unit test
  * TODO: formal
* TODO: add encoding of gfp* to SVP64Asm class (as a 32bit op)
* TODO: add gfp* to TBD pipe(s)
* TODO: fu unit tests
* TODO: fu formal