Wizard's Toolkit Logo Wizard's Toolkit Sprite
Unix
Mac OS X
Windows
Options
Unix
Windows

Module serpent Methods

AcquireSerpentInfo

AcquireSerpentInfo() allocate the SerpentInfo structure.

The format of the AcquireSerpentInfo method is:

  SerpentInfo *AcquireSerpentInfo(void)

DecipherSerpentBlock

DecipherSerpentBlock() deciphers a single block of ciphertext to produce a block of plaintext.

The format of the DecipherSerpentBlock method is:

       void DecipherSerpentBlock(SerpentInfo *serpent_info,
   const unsigned char *ciphertext,unsigned char plaintext)

A description of each parameter follows:

serpent_info

The cipher context.

ciphertext

The cipher text.

plaintext

The plaint text.

DestroySerpentInfo

DestroySerpentInfo() zeros memory associated with the SerpentInfo structure.

The format of the DestroySerpentInfo method is:

  SerpentInfo *DestroySerpentInfo(SerpentInfo *serpent_info)

A description of each parameter follows:

serpent_info

The cipher context.

EncipherSerpentBlock

EncipherSerpentBlock() enciphers a single block of plaintext to produce a block of ciphertext.

The format of the EncipherSerpentBlock method is:

  void EncipherSerpentBlock(SerpentInfo *serpent_info,
    const unsigned char *plaintext,unsigned char ciphertext)

A description of each parameter follows:

serpent_info

The cipher context.

plaintext

The plain text.

ciphertext

The cipher text.

GetSerpentBlocksize

GetSerpentBlocksize() returns the Serpent blocksize.

The format of the GetSerpentBlocksize method is:

  unsigned int *GetSerpentBlocksize(const SerpentInfo *serpent_info)

A description of each parameter follows:

serpent_info

The serpent info.

SetSerpentKey

SetSerpentKey() sets the key for the Serpent cipher. The key length is specified in bits. Valid values are 128,192,or 256 requiring a key buffer length in bytes of 16,24,and 32 respectively.

The format of the SetSerpentKey method is:

  SetSerpentKey(SerpentInfo *serpent_info,const StringInfo *key)

A description of each parameter follows:

serpent_info

The cipher context.

key

The key.