blowfish.state

data type

Library: Blowfish (OMBLOWFISH)
Import : omblowfish.xmd


Purpose

The state opaque data type carries state information between calls to the functions of the OMBLOWFISH library. A state also contains information about the encryption key being used to encrypt or decrypt the data.

Usage Notes

Within your program, you can create as many instances of the state data type as you require. A instance of the state data type can be declared as a global, local, or even passed as an argument to a function.

A particular instance of statemust be initialized using blowfish.set-encryption-key before being used.

Please refer to Opaque Data Types for a general description of opaque data types and how they are used.

Related OMBLOWFISH library functions

The state data type is central to the OMBLOWFISH library, and is used by all of its functions.

Example

Once you have declared an instance of blowfish.state, you must initialize it using blowfish.set-encryption-key.

     import "omblowfish.xmd" prefixed by blowfish.
  
  
     process
        local blowfish.state state
  
        set-encryption-key ("ENCRYPTION KEY", state)

The OMBLOWFISH library exports a conversion function from string to state that can be used to write this example more concisely:

     import "omblowfish.xmd" prefixed by blowfish.
  
  
     process
        local blowfish.state state initial { "ENCRYPTION KEY" }

Other Library Functions