-- --************************************************************************* --* * --* © Copyright 2013, Hewlett-Packard Development Company, L.P. * --* * --* Confidential computer software. Valid license from HP and/or * --* its subsidiaries required for possession, use, or copying. * --* * --* Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * --* Computer Software Documentation, and Technical Data for Commercial * --* Items are licensed to the U.S. Government under vendor's standard * --* commercial license. * --* * --* Neither HP nor any of its subsidiaries shall be liable for technical * --* or editorial errors or omissions contained herein. The information * --* in this document is provided "as is" without warranty of any kind and * --* is subject to change without notice. The warranties for HP products * --* are set forth in the express limited warranty statements accompanying * --* such products. Nothing herein should be construed as constituting an * --* additional warranty. * --* * --************************************************************************* --******************************************************************************************************************** -- Created: 12-Mar-2013 10:27:08 by OpenVMS SDL EV3-3 -- Source: 13-JAN-2012 16:21:42 $1$DGA106:[ENCRYPT.SRC]ENCRYPT_DEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package ENCRYPT_DEF is -- module encrypt_def IDENT V01.10 -- -- Initialize context for encrypt/decrypt operations -- Accepts following arguments -- context : type - longword integer signed; access - write only; mechanism - by reference -- algorithm : type - char_string; access - read/write; mechanism - by descriptor -- key-type : type - longword logical unsigned; access - read only; mechanism - by reference -- key-name : type - char_string; access - read only; mechanism - by descriptor -- [ p1 ] : type - quadword[1] (DES), quadword[2] (AES); access - read only; mechanism - by reference -- procedure ENCRYPT_INIT ( STATUS : out INTEGER_32; -- return value CONTEXT : in out UNSIGNED_LONGWORD; ALGORITHM : in STRING; KEY_TYPE : in UNSIGNED_LONGWORD; KEY_DESCRIPTOR : in STRING; EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_INIT); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_INIT, "encrypt$init", (INTEGER_32, UNSIGNED_LONGWORD, STRING, UNSIGNED_LONGWORD, STRING, UNSIGNED_LONGWORD), (VALUE, REFERENCE, DESCRIPTOR(S), REFERENCE, DESCRIPTOR(S), REFERENCE), EXTRA_PARAMETER); -- -- Perform encryption of next record of plaintext -- Accepts following arguments -- context : type - longword integer signed; access - write only; mechanism - by reference -- input : type - char_string; access - read only; mechanism - by descriptor -- output : type - char_string; access - write only; mechanism - by descriptor -- [output-length] : type - word integer; access - write only; mechanism - by reference -- [p1] : type - quadword[1] (DES), quadword[2] (AES); access - read only; mechanism - by reference -- procedure ENCRYPT_ENCRYPT ( STATUS : out INTEGER_32; -- return value CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; OUTPUT_COUNT : out UNSIGNED_LONGWORD; EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); procedure ENCRYPT_ENCRYPT ( STATUS : out INTEGER_32; -- return value CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; OUTPUT_COUNT : in ADDRESS := ADDRESS_ZERO; -- To omit optional OUTPUT_COUNT argument EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_ENCRYPT); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_ENCRYPT, "encrypt$encrypt", (INTEGER_32, UNSIGNED_LONGWORD, STRING, STRING, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), REFERENCE, REFERENCE), EXTRA_PARAMETER); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_ENCRYPT, "encrypt$encrypt", (INTEGER_32, UNSIGNED_LONGWORD, STRING, STRING, ADDRESS, UNSIGNED_LONGWORD), (VALUE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), VALUE, REFERENCE), OUTPUT_COUNT); -- -- Perform decryption of next record of plaintext -- Accepts following arguments -- context : type - longword integer signed; access - write only; mechanism - by reference -- input : type - char_string; access - read only; mechanism - by descriptor -- output : type - char_string; access - write only; mechanism - by descriptor -- [output-length] : type - word integer; access - write only; mechanism - by reference -- [p1] : type - quadword[1] (DES), quadword[2] (AES); access - read only; mechanism - by reference -- procedure ENCRYPT_DECRYPT ( STATUS : out INTEGER_32; -- return value CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; OUTPUT_COUNT : out UNSIGNED_LONGWORD; EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); procedure ENCRYPT_DECRYPT ( STATUS : out INTEGER_32; -- return value CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; OUTPUT_COUNT : in ADDRESS := ADDRESS_ZERO; -- To omit optional OUTPUT_COUNT argument EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_DECRYPT); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DECRYPT, "encrypt$decrypt", (INTEGER_32, UNSIGNED_LONGWORD, STRING, STRING, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), REFERENCE, REFERENCE), EXTRA_PARAMETER); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DECRYPT, "encrypt$decrypt", (INTEGER_32, UNSIGNED_LONGWORD, STRING, STRING, ADDRESS, UNSIGNED_LONGWORD), (VALUE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), VALUE, REFERENCE), OUTPUT_COUNT); -- -- Disassociates the encryption context and releases it -- Accepts following arguments -- context : type - longword integer signed; access - read/write; mechanism - by reference -- procedure ENCRYPT_FINI ( STATUS : out INTEGER_32; -- return value CONTEXT : in out UNSIGNED_LONGWORD; EXTRA_PARAMETER : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_FINI); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_FINI, "encrypt$fini", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE), EXTRA_PARAMETER); -- -- Gains access to the statistics maintained by the Encryption software -- Accepts following arguments -- context : type - longword; access - read only; mechanism - by reference -- code : type - longword; access - read only; mechanism - by reference -- destination : type - char_string; access - write only; mechanism - by descriptor -- return-length : type - longword; access - write only; mechanism - by reference -- procedure ENCRYPT_STATISTICS ( STATUS : out INTEGER_32; -- return value CONTEXT : in UNSIGNED_LONGWORD; CODE : in UNSIGNED_LONGWORD; DESTINATION : out STRING; RETURN_LENGTH : out UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_STATISTICS); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_STATISTICS, "encrypt$statistics", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, STRING, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE, DESCRIPTOR(S), REFERENCE)); -- -- Places a key definition into the process, group, job, or system key storage table -- Accepts following arguments -- key-name : type - char_string; access - read only; mechanism - by descriptor -- key-value : type - char_string; access - read only; mechanism - by descriptor -- key-flags : type - longword; access - read only; mechanism - by reference -- procedure ENCRYPT_DEFINE_KEY ( STATUS : out INTEGER_32; -- return value KEY_NAME : in STRING; KEY_VALUE : in STRING; KEY_FLAGS : in UNSIGNED_LONGWORD; KEY_PROTECTION : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_DEFINE_KEY); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DEFINE_KEY, "encrypt$define_key", (INTEGER_32, STRING, STRING, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), REFERENCE, REFERENCE), KEY_PROTECTION); -- -- Deletes a key definition from a key storage table -- Accepts following arguments -- key-name : type - char_string; access - read only; mechanism - by descriptor -- key-flags : type - longword; access - read only; mechanism - by reference -- procedure ENCRYPT_DELETE_KEY ( STATUS : out INTEGER_32; -- return value KEY_NAME : in STRING; KEY_FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_DELETE_KEY); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DELETE_KEY, "encrypt$delete_key", (INTEGER_32, STRING, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), REFERENCE)); -- -- Encrypts or decrypts data files -- Accepts following arguments -- input-file : type - char_string; access - read only; mechanism - by descriptor -- output-file : type - char_string; access - read only; mechanism - by descriptor -- key-name : type - char_string; access - read only; mechanism - by descriptor -- algorithm : type - char_string; access - read only; mechanism - by descriptor -- file-flags : type - longword; access - read only; mechanism - by reference -- [item-list] : type - item_list_3; access - read only; mechanism - by descriptor -- procedure ENCRYPT_ENCRYPT_FILE ( STATUS : out INTEGER_32; -- return value INPUT_FILE : in STRING; OUTPUT_FILE : in STRING; KEY_NAME : in STRING; ALGORITHM : in STRING; FILE_FLAGS : in UNSIGNED_LONGWORD; ITEM_LIST : in UNSIGNED_LONGWORD := UNSIGNED_LONGWORD'NULL_PARAMETER); pragma INTERFACE (EXTERNAL, ENCRYPT_ENCRYPT_FILE); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_ENCRYPT_FILE, "encrypt$encrypt_file", (INTEGER_32, STRING, STRING, STRING, STRING, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), REFERENCE, REFERENCE), ITEM_LIST); -- -- Encrypts a small amount of data in an encrypt stream -- Accepts following arguments -- input : type - char_string; access - read only; mechanism - by descriptor -- output : type - char_string; access - write only; mechanism - by descriptor -- key-name : type - char_string; access - read only; mechanism - by descriptor -- algorithm : type - char_string; access - read only; mechanism - by descriptor -- procedure ENCRYPT_ENCRYPT_ONE_RECORD ( STATUS : out INTEGER_32; -- return value INPUT : in STRING; OUTPUT : out STRING; KEY_NAME : in STRING; ALGORITHM : in STRING); pragma INTERFACE (EXTERNAL, ENCRYPT_ENCRYPT_ONE_RECORD); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_ENCRYPT_ONE_RECORD, "encrypt$encrypt_one_record", (INTEGER_32, STRING, STRING, STRING, STRING), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S))); -- -- Decrypts a small amount of data on a decrypt stream -- Accepts following arguments -- input : type - char_string; access - read only; mechanism - by descriptor -- output : type - char_string; access - write only; mechanism - by descriptor -- key-name : type - char_string; access - read only; mechanism - by descriptor -- algorithm : type - char_string; access - read only; mechanism - by descriptor -- procedure ENCRYPT_DECRYPT_ONE_RECORD ( STATUS : out INTEGER_32; -- return value INPUT : in STRING; OUTPUT : out STRING; KEY_NAME : in STRING; ALGORITHM : in STRING); pragma INTERFACE (EXTERNAL, ENCRYPT_DECRYPT_ONE_RECORD); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DECRYPT_ONE_RECORD, "encrypt$decrypt_one_record", (INTEGER_32, STRING, STRING, STRING, STRING), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S))); -- -- Generates a random key value -- Accepts following arguments -- algorithm-name : type - char_string; access - read only; mechanism - by descriptor -- key-length : type - word unsigned; access - read only; mechanism - by reference -- [factor-a] : type - char_string; access - read only; mechanism - by descriptor -- [factor-b] : type - char_string; access - read only; mechanism - by descriptor -- [factor-c] : type - char_string; access - read only; mechanism - by descriptor -- [key-buffer] : type - char_string; access - write; mechanism - by descriptor -- procedure ENCRYPT_GENERATE_KEY ( STATUS : out INTEGER_32; -- return value ALGORITHM : in STRING; KEY_LENGTH : in UNSIGNED_LONGWORD; FACTOR_A : in STRING; FACTOR_B : in STRING; FACTOR_C : in STRING; KEY_BUFFER : out STRING); pragma INTERFACE (EXTERNAL, ENCRYPT_GENERATE_KEY); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_GENERATE_KEY, "encrypt$generate_key", (INTEGER_32, STRING, UNSIGNED_LONGWORD, STRING, STRING, STRING, STRING), (VALUE, DESCRIPTOR(S), REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S))); -- -- Unsupported calls -- procedure ENCRYPT_INIT_ASYN ( STATUS : out INTEGER_32; -- return value EFN : in UNSIGNED_LONGWORD; CONTEXT : in out UNSIGNED_LONGWORD; AST_ADDRESS : in ADDRESS; AST_PARAMETER : in UNSIGNED_LONGWORD; STATUS_BLOCK : in INTEGER_64; ITEM_LIST : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_INIT_ASYN); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_INIT_ASYN, "encrypt$init_asyn", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, ADDRESS, UNSIGNED_LONGWORD, INTEGER_64, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE, VALUE, REFERENCE, REFERENCE, REFERENCE)); procedure ENCRYPT_ENCRYPT_ASYN ( STATUS : out INTEGER_32; -- return value EFN : in UNSIGNED_LONGWORD; CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; AST_ADDRESS : in ADDRESS; AST_PARAMETER : in UNSIGNED_LONGWORD; STATUS_BLOCK : in INTEGER_64; ITEM_LIST : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_ENCRYPT_ASYN); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_ENCRYPT_ASYN, "encrypt$encrypt_asyn", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, STRING, STRING, ADDRESS, UNSIGNED_LONGWORD, INTEGER_64, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), VALUE, REFERENCE, REFERENCE, REFERENCE)); procedure ENCRYPT_DECRYPT_ASYN ( STATUS : out INTEGER_32; -- return value EFN : in UNSIGNED_LONGWORD; CONTEXT : in UNSIGNED_LONGWORD; INPUT : in STRING; OUTPUT : out STRING; AST_ADDRESS : in ADDRESS; AST_PARAMETER : in UNSIGNED_LONGWORD; STATUS_BLOCK : in INTEGER_64; ITEM_LIST : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_DECRYPT_ASYN); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_DECRYPT_ASYN, "encrypt$decrypt_asyn", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, STRING, STRING, ADDRESS, UNSIGNED_LONGWORD, INTEGER_64, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE, DESCRIPTOR(S), DESCRIPTOR(S), VALUE, REFERENCE, REFERENCE, REFERENCE)); procedure ENCRYPT_FINI_ASYN ( STATUS : out INTEGER_32; -- return value EFN : in UNSIGNED_LONGWORD; CONTEXT : in out UNSIGNED_LONGWORD; AST_ADDRESS : in ADDRESS; AST_PARAMETER : in UNSIGNED_LONGWORD; STATUS_BLOCK : in INTEGER_64; ITEM_LIST : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, ENCRYPT_FINI_ASYN); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_FINI_ASYN, "encrypt$fini_asyn", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, ADDRESS, UNSIGNED_LONGWORD, INTEGER_64, UNSIGNED_LONGWORD), (VALUE, REFERENCE, REFERENCE, VALUE, REFERENCE, REFERENCE, REFERENCE)); procedure ENCRYPT_SYNC_ASYN ( STATUS : out INTEGER_32; -- return value EFN : in UNSIGNED_LONGWORD; CONTEXT : in UNSIGNED_LONGWORD; STATUS_BLOCK : in INTEGER_64); pragma INTERFACE (EXTERNAL, ENCRYPT_SYNC_ASYN); pragma IMPORT_VALUED_PROCEDURE (ENCRYPT_SYNC_ASYN, "encrypt$sync_asyn", (INTEGER_32, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD, INTEGER_64), (VALUE, REFERENCE, REFERENCE, REFERENCE)); end ENCRYPT_DEF;