xref: /linux/tools/testing/crypto/chacha20-s390/run-tests.sh (revision 8a922b7728a93d837954315c98b84f6b78de0c4f)
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
14lsmod | grep chacha | cut -f1 -d' ' | xargs rmmod
15modprobe chacha_generic
16modprobe chacha_s390
17
18# run encryption for different data size, including whole block(s) +/- 1
19insmod test_cipher.ko size=63
20insmod test_cipher.ko size=64
21insmod test_cipher.ko size=65
22insmod test_cipher.ko size=127
23insmod test_cipher.ko size=128
24insmod test_cipher.ko size=129
25insmod test_cipher.ko size=511
26insmod test_cipher.ko size=512
27insmod test_cipher.ko size=513
28insmod test_cipher.ko size=4096
29insmod test_cipher.ko size=65611
30insmod test_cipher.ko size=6291456
31insmod test_cipher.ko size=62914560
32
33# print test logs
34dmesg | tail -170
35