Skip to content

Commit 0b7043d

Browse files
authored
Merge pull request #31 from chmodshubham/main
Moved constant-time blogs into a series under PQC
2 parents acb85f9 + 3626f2b commit 0b7043d

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

pqc/constant-time-implementation-for-cryptography.md renamed to pqc/constant-time/constant-time-implementation-for-cryptography.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ In the article from BearSSL, they use a constant-time implementation rather than
5858

5959
1. **Conditional Jumps \-** these are the “if/else” type decisions in code. When the CPU jumps to one part of the program or another based on a condition, it takes slightly different amounts of time because it has to predict which way the jump will go. If the prediction is wrong, the CPU wastes time, and this delay can be measured. So, if the condition in the jump depends on secret data, an attacker might guess that secret by observing the timing.
6060

61-
![vulnerable code snippet to timing attack](./images/constant-time/vulnerable-code-snippet.png)
61+
![vulnerable code snippet to timing attack](./images/vulnerable-code-snippet.png)
62+
6263
_Fig: Example code vulnerable to a timing attack from [Redhat Research](https://research.redhat.com/blog/article/the-need-for-constant-time-cryptography/)_
6364

6465
2. **Memory accesses \-** When the program reads or writes data in memory, the time it takes can depend on where that data is stored. If the data is already in the CPU’s cache, it’s fast. If not, it takes longer to fetch it. Attackers can measure these tiny time differences to figure out which memory locations are being accessed — and from that, they can sometimes guess secret keys. Ciphers like AES, which use substitution tables dependent on secret data, are suitable for this attack even over the network, and also demonstrated here in this paper, [Cache-timing attacks on AES.](https://cr.yp.to/antiforgery/cachetiming-20050414.pdf)

pqc/how-liboqs-uses-valgrind-for-constant-time.md renamed to pqc/constant-time/how-liboqs-uses-valgrind-for-constant-time.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ ninja
103103
python3 ../tests/test_constant_time.py
104104
```
105105

106-
![test_constant_time.py output](./images/constant-time/test_const_time.png)
106+
![test_constant_time.py output](./images/test_const_time.png)
107107

108108
> **Note:** Ignore the extra line breaks — I pressed Enter multiple times to ensure the program hadn’t frozen.
109109
File renamed without changes.
File renamed without changes.

pqc/constant-time/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Constant Time
2+
3+
```{toctree}
4+
:maxdepth: 1
5+
6+
constant-time-implementation-for-cryptography
7+
how-liboqs-uses-valgrind-for-constant-time
8+
```

pqc/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
introduction-to-pqc
77
working-of-oqslib
88
lwe-quantum-proof-algorithm
9-
constant-time-implementation-for-cryptography
10-
how-liboqs-uses-valgrind-for-constant-time
119
```
1210

1311
```{toctree}
1412
:maxdepth: 2
1513
1614
telecom/index
15+
constant-time/index
1716
```

0 commit comments

Comments
 (0)