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