Skip to content

Commit 629fcfc

Browse files
pqcfoxalevy
authored andcommitted
tutorials: root_of_trust: split suspicious_service into a milestone and starter
1 parent d1b7f13 commit 629fcfc

File tree

13 files changed

+77
-11
lines changed

13 files changed

+77
-11
lines changed

examples/tutorials/root_of_trust/encryption_service_milestone_one/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Specific abilities of this version:
1212

1313
* Allows logging to screen over IPC
1414
* Does NOT allow prompting for plaintext over returning results in hex over UART
15-
* Does NOT allow for encryping user-provided plaintext using an encryption oracle driver
15+
* Does NOT allow for encrypting user-provided plaintext using an encryption
16+
oracle driver

examples/tutorials/root_of_trust/encryption_service_milestone_one/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Hardware Root of Trust (HWRoT) Demo Encryption Service Application
2+
//
3+
// When selected by the main screen HWRoT Demo application, listens for user-provided
4+
// plaintexts over UART and encrypts them, logging status over IPC back to the screen
5+
// application.
6+
17
#include "libtock/tock.h"
28
#include <stdio.h>
39
#include <stdlib.h>

examples/tutorials/root_of_trust/encryption_service_milestone_three/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Specific abilities of this version:
1212

1313
* Allows logging to screen over IPC
1414
* Allows prompting for plaintext over returning results in hex over UART
15-
* Allows for encryping user-provided plaintext using an encryption oracle driver
15+
* Allows for encrypting user-provided plaintext using an encryption oracle
16+
driver

examples/tutorials/root_of_trust/encryption_service_milestone_three/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Hardware Root of Trust (HWRoT) Demo Encryption Service Application
2+
//
3+
// When selected by the main screen HWRoT Demo application, listens for user-provided
4+
// plaintexts over UART and encrypts them, logging status over IPC back to the screen
5+
// application.
6+
17
#include "libtock/tock.h"
28
#include <stdio.h>
39
#include <stdlib.h>

examples/tutorials/root_of_trust/encryption_service_milestone_two/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Specific abilities of this version:
1212

1313
* Allows logging to screen over IPC
1414
* Allows prompting for plaintext over returning results in hex over UART
15-
* Does NOT allow for encryping user-provided plaintext using an encryption oracle driver
15+
* Does NOT allow for encrypting user-provided plaintext using an encryption
16+
oracle driver

examples/tutorials/root_of_trust/encryption_service_milestone_two/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Hardware Root of Trust (HWRoT) Demo Encryption Service Application
2+
//
3+
// When selected by the main screen HWRoT Demo application, listens for user-provided
4+
// plaintexts over UART and encrypts them, logging status over IPC back to the screen
5+
// application.
6+
17
#include "libtock/tock.h"
28
#include <stdio.h>
39
#include <stdlib.h>

examples/tutorials/root_of_trust/encryption_service_starter/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Specific abilities of this version:
1212

1313
* Does NOT allow logging to screen over IPC
1414
* Does NOT allow for plaintext over returning results in hex over UART
15-
* Does NOT allow for encryping user-provided plaintext using an encryption oracle driver
15+
* Does NOT allow for encrypting user-provided plaintext using an encryption
16+
oracle driver
1617

17-
This application is essentially just a scaffold to build from while following the tutorial.
18+
This version of the application is essentially just a scaffold to build from
19+
while following the tutorial.
File renamed without changes.

examples/tutorials/root_of_trust/suspicious_service/README.md renamed to examples/tutorials/root_of_trust/suspicious_service_milestone_one/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Hardware Root of Trust (HWRoT) "Suspicious" Userspace Attack Application
22
------------------------------------------------------------------------
33

4-
This application implements a basic SRAM dump attack on the encryption servicde
4+
This application implements a basic SRAM dump attack on the encryption service
55
application in the Hardware Root of Trust demo.
66

77
This is part of a tutorial which improves the encryption application in multiple

examples/tutorials/root_of_trust/suspicious_service/main.c renamed to examples/tutorials/root_of_trust/suspicious_service_milestone_one/main.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Hardware Root of Trust (HWRoT) Demo SRAM Dump Application
2+
//
3+
// When selected by the main screen HWRoT Demo application, attempts to dump its
4+
// own SRAM, followed by the SRAM of the encryption service application.
5+
16
#include "libtock/tock.h"
27
#include <stdio.h>
38
#include <stdlib.h>
@@ -82,8 +87,8 @@ static int log_to_screen(const char* message) {
8287
return 0;
8388
}
8489

85-
static void dump_memory(uint32_t *start, uint32_t *end, const char *label) {
86-
for (uint32_t *addr = start; addr < end; addr++) {
90+
static void dump_memory(uint32_t* start, uint32_t* end, const char* label) {
91+
for (uint32_t* addr = start; addr < end; addr++) {
8792
printf("[%s] %p: %08lX\n", label, addr, *addr);
8893
}
8994
}
@@ -105,7 +110,7 @@ int main(void) {
105110
if (ret < 0) {
106111
printf("ERROR: cannot log to screen\n");
107112
}
108-
dump_memory((uint32_t *)SELF_SRAM_START, (uint32_t *)SELF_SRAM_END, "SELF");
113+
dump_memory((uint32_t*)SELF_SRAM_START, (uint32_t*)SELF_SRAM_END, "SELF");
109114
ret = log_to_screen("Dumping own SRAM complete!");
110115
if (ret < 0) {
111116
printf("ERROR: cannot log to screen\n");
@@ -116,11 +121,11 @@ int main(void) {
116121
if (ret < 0) {
117122
printf("ERROR: cannot log to screen\n");
118123
}
119-
dump_memory((uint32_t *)ENCRYPTION_SRAM_START, (uint32_t *)ENCRYPTION_SRAM_END, "ENCRYPTION");
124+
dump_memory((uint32_t*)ENCRYPTION_SRAM_START, (uint32_t*)ENCRYPTION_SRAM_END, "ENCRYPTION");
120125
ret = log_to_screen("Dumping encryption SRAM complete!");
121126
if (ret < 0) {
122127
printf("ERROR: cannot log to screen\n");
123128
}
124-
129+
125130
return 0;
126131
}

0 commit comments

Comments
 (0)