Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.
Announcements
1467 Discussions

## Side-channel-resistant Math Function

New Contributor I
899 Views

I need to take the natural logarithm of a number, in such a way that access patterns and running time leak no information about the input/output.
Does the provided "cmath" standard library satisfy this criterion? If not, would you please point me to some literature on side-channel resistant real-valued computation?

6 Replies
Employee
899 Views

https://en.wikipedia.org/wiki/Timing_attack

Please see GNUC preliminary safety assessment for these math functions and their associated POSIX safety concepts before use:

http://www.gnu.org/software/libc/manual/html_node/Exponents-and-Logarithms.html#Exponents-and-Logarithms

New Contributor I
899 Views

The Wikipedia article is of no use, since it only expounds on the concept of timing attacks. There is a brief reference to exponentiation, but not to its inverse.

The GNU documentation is not useful either, since it makes no reference to cryptographic security.

Employee
899 Views

are the section 6.2, 6.3 and 6.6 in this SGX document of your interest?

https://eprint.iacr.org/2016/086.pdf

New Contributor I
899 Views

Thank you for getting back so quickly.

The paper by Costan and Devadas, although a great document (I personally started with SGX by reading it) doesn't help in this particular case.

What I need is a side-channel-resistant implementation of a (natural) logarithm.

Employee
899 Views

If you are just trying to stop an attack on measuring the processing time with different input and output, can you simply use the brute force approach by adding a small random number of wasted cycles in your processing in the Enclave such as taking a modulo of your secret hash number with a prime number? It will make the processing time undecodable.

Regarding to your natural logarithm, if you can substitute it with binary logarithm, then you can implement it with shift operations. Therefore, you don't need to include any math library.

If you do need to include math library, as long as you can statically link the library into your application, it is a good step to make sure it can be run inside the Enclave. Further security analysis of that library should be done to make sure it is still safe to call.

Employee
899 Views

This research paper on Obfuscated Execution may be of your interest if you have not seen it

https://www.cs.utexas.edu/~lin/papers/usenix15.pdf