-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: tried to spill OF, but didnt work. TSNH. #204
Comments
I think the problem is that there is no support for adding two carry bits with one 64 bit limb, when both of those bits are in CF and OF respectively.
And the next operation is then to add both of those flags to seto bl
movzx rbx, bl
adcx rax, rbx And the carry out is in CF, the result in rax. Long story short, i believe its a bug in CryptOpt, It surely is the offending operation. {
"datatype": "u64",
"name": ["x200"],
"operation": "<<",
"parameters": { "size": 64 },
"arguments": ["x58", "0x0"]
}, or {
"datatype": "u64",
"name": ["x200"],
"operation": "&",
"parameters": { "size": 64 },
"arguments": ["x58", "0x1"]
}, and replace the "x58" in the operation that uses "x58" with "x200". The reason why this is bad is that I've locally tried "x58 + 0" but in no fiat function we ever had "addition with a constant", neither would "x200 = x58" work, because "="-operations are assumed to write to |
As the output carry is unused, I believe the desired assembly code would be adcx x40, zero
adox x40, zero
|
that would be one way to do it, if there is a register with a
or, potentially
but that would require more support in many tools... So I'll try to fix it with the former. |
Sounds good, thanks! The first alternative seems fine. Another variant that may be worth trying: mov rax, 0
adcx rax, rax
adox x40, rax |
The equivalence checker would accept both, right? |
Yep, I've been switching back and forth between these manually in cryptopt output. |
p256sqr2.zip
It is possible that the input is silly, I haven't proven anything about it yet.
The text was updated successfully, but these errors were encountered: