[JoGu]

Kryptologie

A program for the WALSH transform

a7Hzq .#5r<
kÜ\as TâÆK$
ûj(Ö2 ñw%h:
Úk{4R f~`z8
¤˜Æ+Ô „&¢Dø

The program reads from standard input and writes to standard output. The output was generated by the command line

      wt < data.txt > result.txt


The input file

Input and output are in "natural order": The bit string u1u2u3u4 is represented by the integer 8u1 + 4u2 + 2u3 + u4.

The input function must assume only integer values.

As an example consider the integer valued function that is the character form of the BOOLEan function f defined by

f(x1,x2,x3,x4) = x1x2+x3x4.
The value table (or truth table) of f is

Binary vector xValue f(x)
00000
00010
00100
00111
01000
01010
01111
10000
10010
10100
10111
11001
11011
11110

The character form (or polar form) of f is g(x) := cf(x1x2x3x4) = (-1)x1x2+x3x4. Therefore the input file for wt is the right column of the table

Binary vector xValue g(x)
00001
00011
00101
0011-1
01001
01011
01101
0111-1
10001
10011
10101
1011-1
1100-1
1101-1
1110-1
11111

The output file

The output file essentially consists of the value table of the transformed function g^:

Binary vector uValue g^(u)
00004
00014
00104
0011-4
01004
01014
01104
0111-4
10004
10014
10104
1011-4
1100-4
1101-4
1110-4
11114

In this example g^ = 4 g. This is a special feature of this special function: g is »self-dual«.


Author: Klaus Pommerening, 12 April 2000; last change: 6 June 2005.