aboutsummaryrefslogtreecommitdiffstats
path: root/hw/crypto_algo_sweep.sh
blob: b6e655c8f6d7df1a0349aac1e3b2af1ecfd54753 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# sweep candidate GP-TEE algo IDs for op 0x01 (create context); look for status 0 + handle at M[14]
for ALGO in 0x50000005 0x50000001 0x50000002 0x50000006 0x10000011 0x10000111 0x30000002; do
  cd /root/psp && source ./env.sh >/dev/null 2>&1
  rm -f /tmp/am_usb*.lock
  $PSP_PY work/atx_power.py cycle 16 >/dev/null 2>&1
  cd /root/psp/hw
  AD=$(python3 -c "print(int(\"$ALGO\",16))")
  echo "==== algo=$ALGO ===="
  OPCODE=0x1 MSGSPEC="{\"15\": $AD}" timeout 150 $PSP_PY /root/psp/hw/gcp_rop_crypto.py 2>&1 | grep -E "RESULT|svc 0xf2 return" | head -3
done
echo ALGO-SWEEP-DONE