data type
|
Library: Blowfish (OMBLOWFISH)
Import : omblowfish.xmd |
The blowfish.state opaque data type carries state information between calls to the functions of
the OMBLOWFISH library. An instance of state also contains information about the
encryption key being used to encrypt or decrypt the data.
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 blowfish.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" }
To use this type, you must import OMBLOWFISH into your program using an import
declaration such as:
import "omblowfish.xmd" prefixed by blowfish.
Within your program, you can create as many instances of the blowfish.state data type as you
require. A instance of the blowfish.state data type can be declared as
a global, local, or even passed as an argument to a function.
A particular instance of blowfish.state must be initialized
using blowfish.set-encryption-key before being used.