Skip to content
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

Measure time spent in SHA2, SHA3, and randombytes #29

Closed
mkannwischer opened this issue Oct 22, 2018 · 2 comments
Closed

Measure time spent in SHA2, SHA3, and randombytes #29

mkannwischer opened this issue Oct 22, 2018 · 2 comments
Milestone

Comments

@mkannwischer
Copy link
Contributor

As in our recent paper, it would be nice to have some profiling information on how much time is spent in hashing and randombytes.
This should also give an intuition how the schemes sample randomness.

We implemented this by adding/subtracting the current cycle count to a global variable when entering/leaving the respective function. This should be done only for profiling, but not in the benchmarks since it can have a huge performance impact. It would be nice to port that to PQM4.

In case we want to use systick for this, then we will run into the problem that if the overflow occurs within one of the profiled functions the cycle counts are useless. In our paper experiments, we just detected this case and ran it several times until we had no overflow there - this won't work for SPHINCS.

@Ko-
Copy link
Contributor

Ko- commented Oct 22, 2018

I don't really see why we couldn't account for that. We're already doing that for counting cycles in speed.c with systick, right? Every overflow triggers an interrupt and those are counted. Of course this logic has some overhead, but if it only happens every 2,400,000 cycles then that shouldn't be very significant.

There's also this approach to profiling applications with gprof. I looked into it at some point, but it's slightly more cumbersome. Definitely a downside is that it requires extra hardware, although I think we have that in the office. It's probably technically possible to do without, but that would require implementing some low-level I/O functions ourselves to make sure that gprof.out gets written to USART on exit.

@mkannwischer
Copy link
Contributor Author

mkannwischer commented Oct 23, 2018 via email

@mkannwischer mkannwischer added this to the round2 milestone Mar 13, 2019
mkannwischer added a commit that referenced this issue Mar 21, 2019
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

No branches or pull requests

2 participants