Skip to content

Exercises for Chapter 18 including some extra crypto programs/SV stuff #1376

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

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
51dde3c
Add SHA Python files originally used for ECEN2233 at OSU
stineje Apr 16, 2025
81d1d24
add cool hashlib comparison of expected
stineje Apr 16, 2025
d8c181b
fix comments in both Python files for SHA
stineje Apr 16, 2025
d7a0160
fix typo in C code that printed out stuff in the wrong order and not …
stineje Apr 18, 2025
7ff6b44
remove binary
stineje Apr 18, 2025
f12257c
update row-order row typo
stineje Apr 18, 2025
95ec5a5
Ch 18 Exercise on AES
stineje Apr 18, 2025
4c93682
delete old temp programs
stineje Apr 18, 2025
a5daf64
update number of instructions and final result to Ch 18 P6
stineje Apr 18, 2025
4b11ba6
remove binary
stineje Apr 18, 2025
f5dd0bd
initial problem for Ch 18 on SHA-256
stineje Apr 18, 2025
6274982
add some comments
stineje Apr 18, 2025
bfa005f
add spike stuff
stineje Apr 18, 2025
88c4b97
Add SV files for SHA-256/SHA-512 as separate elements
stineje Apr 19, 2025
eb6b8a5
Final SHA-256 RISC-V assembly using K extension instructions
stineje Apr 19, 2025
6142503
remove old version
stineje Apr 19, 2025
b6376d4
some more comments into sha256.S
stineje Apr 19, 2025
a089b75
remove storage of message and remove old file
stineje Apr 19, 2025
3cfe94d
fix some output of the keyexpansion that is not printing out all valu…
stineje Apr 19, 2025
c76849d
fix printState with wrong col-order vs. row-order
stineje Apr 19, 2025
2ed8255
add VERBOSE option for printing
stineje Apr 19, 2025
c91d3e4
Add pattern role to VERBOSE to force it to recompile
stineje Apr 19, 2025
9639b0d
fix typo
stineje Apr 19, 2025
5dbfa06
initial version that includes ELF file compile
stineje Apr 19, 2025
eba7c15
slight tweak to Makefile
stineje Apr 19, 2025
78dd22c
greatly simplify C code for AES
stineje Apr 20, 2025
9cc476f
remove README
stineje Apr 20, 2025
8d52640
add aes128 for rv64
stineje Apr 20, 2025
a27f14a
Update RV64 version of AES-128
stineje Apr 20, 2025
3f52319
delete old file
stineje Apr 20, 2025
c01da8d
fix typo on AES128.S for RV64
stineje Apr 20, 2025
55d8e82
Update ch18 P6
stineje Apr 20, 2025
a869e30
remove binary from aes crypto
stineje Apr 20, 2025
5da9a7c
delete old file
stineje Apr 20, 2025
7d4dcb7
fix some crypto aes items
stineje Apr 20, 2025
9b4b53d
add example for ch 18 p5
stineje Apr 20, 2025
e70d2f0
delete excess files
stineje Apr 20, 2025
aa5ccea
README for crypto/sha
stineje Apr 20, 2025
860e0a4
remove binary for aes - apologies
stineje Apr 20, 2025
6104206
minor fix in aes128.S for RV64
stineje Apr 22, 2025
b093d19
add Emelia's name to SHA512 stuff who helped
stineje Apr 22, 2025
eaeb81c
change header
stineje Apr 22, 2025
9aa6621
update comment
stineje Apr 22, 2025
26bf29f
update Makefile
stineje Apr 22, 2025
272efeb
remove -Dls as -D is sufficient
stineje Apr 22, 2025
78b6cd5
update Makefile for aes to remove RV64
stineje Apr 22, 2025
137859f
add problem in comparison in using C vs. using K extension
stineje Apr 22, 2025
453a3d1
add problem in comparison in using C vs. using K extension
stineje Apr 22, 2025
94885f4
remove old .data with aes128.S
stineje Apr 22, 2025
109f37d
clean up a comment
stineje Apr 22, 2025
4a75e00
update aes128 with RV64 for main loop
stineje Apr 23, 2025
f301f22
Add Ch 18 Exercise 10 that does a complete AES-128 with RV64
stineje Apr 23, 2025
a8ba572
Add C analysis of AES-128 with RV64 using mcycle/minstret
stineje Apr 23, 2025
b914f49
Add Emelia to work from sha512.sv
stineje Apr 23, 2025
edb0b7b
instruction count down to 450 and optimized as much as possible.
stineje Apr 23, 2025
eaadcc8
cleanup of aes128.S a slight amount on comments
stineje Apr 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions examples/crypto/aes/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
CC = gcc
CFLAGS = -g

all: aes
RISCV_CC = riscv64-unknown-elf-gcc
RISCV_OBJDUMP = riscv64-unknown-elf-objdump
COMMON_DIR = ../../C/common
RISCV_CFLAGS = -gdwarf-2 -march=rv64gc -mabi=lp64d -mcmodel=medany \
-nostdlib -static -lm -fno-tree-loop-distribute-patterns \
-nostartfiles -T$(COMMON_DIR)/test.ld -I$(COMMON_DIR)

aes: aes.c
$(CC) $(CFLAGS) aes.c -o aes
TARGET = aes

clean:
rm -rf aes
rm -f *~
.PHONY: all clean $(TARGET) $(TARGET).elf $(TARGET).objdump

all: $(TARGET) $(TARGET).elf $(TARGET).objdump

.PHONY: all clean
$(TARGET): $(TARGET).c
$(CC) $(CFLAGS) -o $@ $<

clean:
rm -f $(TARGET) $(TARGET).elf $(TARGET).objdump *~
Loading