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