[Libre-soc-bugs] [Bug 1157] Implement poly1305

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Nov 17 19:52:56 GMT 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1157

--- Comment #33 from Sadoon Albader <sadoon at albader.co> ---
(In reply to Luke Kenneth Casson Leighton from comment #3)
> what you can do is: 
> 
> * 2 regs with consts 0xffff and 0x3fffff then REMAP Indices
>   0 1 0 0 1 0
> * another 2 regs with shift amounts 44 and 42 then REMAP
>   Indices 0 1 0 0 1 0 oh look those are the same, use the
>   exact same SVSHAPE as above
> * 2 regs with a constant 1 and 5 for a mul c*1 or c*5,
>   here you will need a 2nd REMAP Index 0 0 1 0 0 1
> * 3 regs h0 h1 h2 use another REMAP Index 1 2 0 1 2 0

I've been trying to understand this for 6 hours so..
here goes:

x = [0] * 16
x[0] = 0xffff
x[1] = 0x3fffff
x[2] = 44
x[3] = 42
x[4] = 1
x[5] = 5
x[6] = h1
x[7] = h2
x[8] = h0

setvl 0, 0, 2(?), 1, 1, 1 # 2 because we have two registers?
svindex 0/2, 0, 1, 0(?), 0, 1, 0 # 0 because they are 64-bit?
svindex 2/2, 1, 1, 0, 0, 1, 0
svindex 4/2, 2, 1, 0, 0, 1, 0
setvl 0, 0, 3(?), 1, 1, 1 # 3 because we have 3 registers?
svindex 6/2, 3, 1, 0, 0, 1, 0

I would start with the remaps but I highly doubt this setvl and svindex
instructions are correct. The ChaCha20 pages and code are elaborate but I need
a few much simpler examples to wrap my head around this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list