GNU Linux-libre 6.8.7-gnu
[releases.git] / tools / testing / crypto / chacha20-s390 / run-tests.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 #
4 # Copyright (C) 2022 Red Hat, Inc.
5 # Author: Vladis Dronov <vdronoff@gmail.com>
6 #
7 # This script runs (via instmod) test-cipher.ko module which invokes
8 # generic and s390-native ChaCha20 encryprion algorithms with different
9 # size of data. Check 'dmesg' for results.
10 #
11 # The insmod error is expected:
12 # insmod: ERROR: could not insert module test_cipher.ko: Operation not permitted
13
14 lsmod | grep chacha | cut -f1 -d' ' | xargs rmmod
15 modprobe chacha_generic
16 modprobe chacha_s390
17
18 # run encryption for different data size, including whole block(s) +/- 1
19 insmod test_cipher.ko size=63
20 insmod test_cipher.ko size=64
21 insmod test_cipher.ko size=65
22 insmod test_cipher.ko size=127
23 insmod test_cipher.ko size=128
24 insmod test_cipher.ko size=129
25 insmod test_cipher.ko size=511
26 insmod test_cipher.ko size=512
27 insmod test_cipher.ko size=513
28 insmod test_cipher.ko size=4096
29 insmod test_cipher.ko size=65611
30 insmod test_cipher.ko size=6291456
31 insmod test_cipher.ko size=62914560
32
33 # print test logs
34 dmesg | tail -170