Skip to content

Commit f0c3401

Browse files
committed
Add a script that runs tests on the AES driver
1 parent a367328 commit f0c3401

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • freemyipod/initramfs/rootfs-template/usr/bin
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
dd if=/dev/zero of=/16z bs=1024 count=16
6+
dd if=/dev/random of=/16r bs=1024 count=16
7+
8+
for ALGO in 'ecb(aes)' 'cbc(aes)' 'cbc(aes-gid)' 'cbc(aes-uid)'
9+
do
10+
for F in /16z /16r
11+
do
12+
echo "Processing ${F} using ${ALGO}..."
13+
# encrypt
14+
aes-test 1 "${ALGO}" < "${F}" > "${F}-${ALGO}-encrypted"
15+
# decrypt
16+
aes-test 0 "${ALGO}" < "${F}-${ALGO}-encrypted" > "${F}-${ALGO}-plain"
17+
18+
diff -s "${F}" "${F}-${ALGO}-plain" || true
19+
done
20+
done

0 commit comments

Comments
 (0)