Skip to content

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Sep 8, 2023

In the test case, at the location:

let qBits = mBits-ctz
let pBits = 1+ctz
let qWords = qBits.wordsRequired()
let pWords = pBits.wordsRequired()
var qBuf = allocStackArray(SecretWord, M.len)
var a1Buf = allocStackArray(SecretWord, M.len)
var a2Buf = allocStackArray(SecretWord, pWords)
var yBuf = allocStackArray(SecretWord, pWords)
var qInv2kBuf = allocStackArray(SecretWord, pWords)
template q: untyped = qBuf.toOpenArray(0, M.len-1) # TODO use qWords instead of M.len
template a1: untyped = a1Buf.toOpenArray(0, M.len-1)

We use q.len == M.len instead of the exact q length needed as derived by mBits-count of trailing zeros.
That was a workaround used while waiting to fix an issue.
Unfortunately the higher words were left uninitialized.

@mratsim mratsim changed the title Fuzz failure 5-3 modexp: Fuzz failure 5-3 Sep 8, 2023
@mratsim mratsim merged commit f3a5f35 into master Sep 9, 2023
@mratsim mratsim deleted the fuzz-5-3 branch September 17, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant