Implementation status: to be implemented

Synopsis

#include <unistd.h>

void encrypt(char block[64], int edflag);

Description

The function encodes the given text.

Arguments:

block[64] - the array containing text to be encoded / decoded due to the edflag value. It contains only bytes with values 0 or 1.

edflag - the flag deciding if the block is to be encoded (value 0) or decoded (value 1).

The encrypt() function provides access to the encoding algorithm. The key generated by setkey() is used to encrypt the string block with encrypt().

The array is modified in place to a similar array using the key set by setkey(). If edflag is 0, the argument is encoded. If edflag is 1, the argument is decoded; if the argument is not decoded, errno is set to [ENOSYS].

The encrypt() function need not be thread-safe.

Return value

The encrypt() function does not return a value.

Errors

[ENOSYS] - The functionality is not supported on this implementation.

Implementation tasks

  • Implement the encrypt() function.