; ; ************************************************************************* ; * * ; * © Copyright 2010, 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: 30-Mar-2010 17:25:19 by OpenVMS SDL EV3-3 ; Source: 21-SEP-2005 15:44:14 $1$DGA7274:[ENCRYPT.SRC]ENCRYPT_STRUCTURES.SDL;/ ; ******************************************************************************************************************************** .MACRO $ENCSTRDEF,$GBL $DEFINI ENCSTR,$GBL ; Definitions for Encryption structures ; KEY_SYSTEM system ; KEY_GROUP group ; KEY_PROCESS process ; KEY_JOB job ; KEY_LITERAL literal key definition, don't compress ; KEY_AES AES Key encryption/decryption $EQU ENCRYPT$M_KEY_SYSTEM <^X1> $EQU ENCRYPT$M_KEY_GROUP <^X2> $EQU ENCRYPT$M_KEY_PROCESS <^X4> $EQU ENCRYPT$M_KEY_JOB <^X8> $EQU ENCRYPT$m_avail1 <^X10> $EQU ENCRYPT$M_KEY_LITERAL <^X20> $EQU ENCRYPT$M_KEY_AES <^X40> $EQU ENCRYPT$V_KEY_SYSTEM 0 $EQU ENCRYPT$V_KEY_GROUP 1 $EQU ENCRYPT$V_KEY_PROCESS 2 $EQU ENCRYPT$V_KEY_JOB 3 $EQU ENCRYPT$v_avail1 4 $EQU ENCRYPT$V_KEY_LITERAL 5 $EQU ENCRYPT$V_KEY_AES 6 $EQU ENCRYPT$M_VALID_KEY_BITS 111 ; KEY$SYSTEM system ; KEY$GROUP group ; KEY$PROCESS process ; KEY$JOB job ; avail1 unused ; KEY$LITERAL literal key definition, don't compress ; KEY$AES AES Key encryption/decryption $EQU ENCRYPT$K_KEY$SYSTEM 0 $EQU ENCRYPT$K_KEY$GROUP 1 $EQU ENCRYPT$K_KEY$PROCESS 2 $EQU ENCRYPT$K_KEY$JOB 3 $EQU ENCRYPT$k_avail1 4 $EQU ENCRYPT$K_KEY$LITERAL 5 $EQU ENCRYPT$K_KEY$AES 6 ; FILE_ENCRYPT encrypt/decrypt direction ; FILE_DELETE delete source file after operation ; FILE_ERASE erase source file when deleting ; FILE_LOG log file operation ; FILE_UNUSED -unused ; FILE_STATISTICS log statistics too ; FILE_COMPRESS compress input ; FILE_EXTLOG extended log ; FILE_IGNORE_CRC Ignore CRC generation/checking ; FILE_V011 Generate V1.1-compatible ciphertext file ; FILE_KEY_VALUE Pass a key by value ; FILE_AES AES File Operation $EQU ENCRYPT$M_FILE_ENCRYPT <^X1> $EQU ENCRYPT$M_FILE_DELETE <^X2> $EQU ENCRYPT$M_FILE_ERASE <^X4> $EQU ENCRYPT$M_FILE_LOG <^X8> $EQU ENCRYPT$M_FILE_UNUSED <^X10> $EQU ENCRYPT$M_FILE_STATISTICS <^X20> $EQU ENCRYPT$M_FILE_COMPRESS <^X40> $EQU ENCRYPT$M_FILE_EXTLOG <^X80> $EQU ENCRYPT$M_FILE_IGNORE_CRC <^X100> $EQU ENCRYPT$M_FILE_V011 <^X200> $EQU ENCRYPT$M_FILE_KEY_VALUE <^X400> $EQU ENCRYPT$M_FILE_AES <^X800> $EQU ENCRYPT$S_FILE_OPS 2 $EQU ENCRYPT$V_FILE_ENCRYPT 0 $EQU ENCRYPT$V_FILE_DELETE 1 $EQU ENCRYPT$V_FILE_ERASE 2 $EQU ENCRYPT$V_FILE_LOG 3 $EQU ENCRYPT$V_FILE_STATISTICS 5 $EQU ENCRYPT$V_FILE_COMPRESS 6 $EQU ENCRYPT$V_FILE_EXTLOG 7 $EQU ENCRYPT$V_FILE_IGNORE_CRC 8 $EQU ENCRYPT$V_FILE_V011 9 $EQU ENCRYPT$V_FILE_KEY_VALUE 10 $EQU ENCRYPT$V_FILE_AES 11 $EQU ENCRYPT$M_VALID_FILE_BITS 4079 ; KEY_LENGTH /* original key string length ; KEYF_IS_COMPRESSED /* key is compressed text ; KEYF_LITERAL /* key is literal value ; KEYF_TOBE_COMPRESSED /* compression was deferred ; KEYF_AES /* Key is AES encrypted ; KEYF_UNUSED /* unused $EQU encrypt$m_keyf_is_compressed <^X1> $EQU encrypt$m_keyf_literal <^X2> $EQU encrypt$m_keyf_tobe_compressed <^X4> $EQU encrypt$m_keyf_aes <^X8> $EQU encrypt$S_stored_key_flags 4 $EQU encrypt$w_key_length 0 $EQU encrypt$S_key_flags_u 2 $EQU encrypt$r_key_flags_u 2 $EQU encrypt$S_key_flags_w 2 $EQU encrypt$r_key_flags_w 2 $EQU encrypt$w_key_flags 2 $EQU encrypt$S_key_flags_b 2 $EQU encrypt$r_key_flags_b 2 $EQU encrypt$v_keyf_is_compressed 0 $EQU encrypt$v_keyf_literal 1 $EQU encrypt$v_keyf_tobe_compressed 2 $EQU encrypt$v_keyf_aes 3 $EQU ENCRYPT$M_VALID_DES_KEY_FLAGS 7 $EQU ENCRYPT$M_VALID_AES_KEY_FLAGS 15 ; ; Programmable interface itemlist item codes ; ; Algorithm specific optional parameters. For example with the ; DES based algorithms, is defined as the address ; of an 8-byte initialization vector (IV) to be used instead of ; any residual IV remaining from a previous operation. ; The interpretation of these parameters is documented with ; the specific algorithms. ; optparam_one Optional Parameter ; optparam_two Optional Parameter ; optparam_three Optional Parameter ; optparam_four Optional Parameter ; optparam_five Optional Parameter ; optparam_six Optional Parameter ; optparam_seven Optional Parameter ; optparam_eight Optional Parameter ; ; References the actual key value to be used. Overrides ; any key name/value reference supplied in other call ; parameters ; key_name A key namestring ; key_value A key value ; key_flags Key interpretation flags ; ; Algorithm name specification ; algorithm_spec algorithm name or type specification ; algorithm_type algorithm specification type code ; ; for encrypt$encrypt_file() parameters ; data_algorithm inner algorithm name specification ; qual_context common qualifier context ; ; max maximum itemlist number $EQU encrypt$k_optparam_one 1 $EQU encrypt$k_optparam_two 2 $EQU encrypt$k_optparam_three 3 $EQU encrypt$k_optparam_four 4 $EQU encrypt$k_optparam_five 5 $EQU encrypt$k_optparam_six 6 $EQU encrypt$k_optparam_seven 7 $EQU encrypt$k_optparam_eight 8 $EQU encrypt$k_key_name 9 $EQU encrypt$k_key_value 10 $EQU encrypt$k_key_flags 11 $EQU encrypt$k_algorithm_spec 12 $EQU encrypt$k_algorithm_type 13 $EQU encrypt$k_data_algorithm 14 $EQU encrypt$k_qual_context 15 $EQU encrypt$k_max 16 ; ; Key name/value switch ; $EQU encrypt$k_name_specified 0 $EQU encrypt$k_value_specified 1 ; ; Define structure for file encryption generated key vector ; ; FIL_BUFLEN length of this record ; FIL_FILEVER file encrypt routine version ; FIL_FILEUPD decimal version ; ---> FIL_KEY and FIL_IV are assumed to be contiguous ; FIL_KEY data key value ; FIL_IV initialize vector value ; ---> FIL_KEY and FIL_IV are assumed to be contiguous ; FIL_ALGCODE file data encryption algorithm code ; FIL_FLAGS file encryption flags ; FIL_COMPRESSED file was compressed before enc ; FIL_LONGCHECKSUM longidudinal checksum present ; FIL_ATR_LEN size of attribute record ; FIL_COMPRESS_MAX blocks in compress buffer ; FIL_ENCRYPT_MAX blocks in encrypt buffer ; FIL_DCXMAP_LEN size of DCX map record if present ; FIL_ALGNAM_LEN size of data encryption algorithm ; FIL_ALGNAM_STR data encryption alg name ; /* this is a varying length string with the next allocated field ; /* starting 'algnam_len' bytes after 'algnam_str' ; FIL_XKEY extended key (counted string) ; FIL_XIV extended IV (counted) ; FIL_XALGNAM_LEN extended size of data encryption algorithm - AES ; FIL_XALGNAM_STR extended ALG name string - for AES ; FIL_FILLER filler to pad to 256 bytes ; FIL_CHECKSUM structure checksum $EQU ENCRYPT$M_FIL_COMPRESSED <^X1> $EQU ENCRYPT$M_FIL_LONGCHECKSUM <^X2> $EQU ENCRYPT$S_FIL_RECORD 256 $EQU ENCRYPT$W_FIL_BUFLEN 0 $EQU ENCRYPT$B_FIL_FILEVER 2 $EQU ENCRYPT$B_FIL_FILEUPD 3 $EQU ENCRYPT$S_FIL_KEY 8 $EQU ENCRYPT$Q_FIL_KEY 4 $EQU ENCRYPT$S_FIL_IV 8 $EQU ENCRYPT$Q_FIL_IV 12 $EQU ENCRYPT$L_FIL_ALGCODE 20 $EQU ENCRYPT$L_FIL_FLAGS 24 $EQU ENCRYPT$V_FIL_COMPRESSED 0 $EQU ENCRYPT$V_FIL_LONGCHECKSUM 1 $EQU ENCRYPT$W_FIL_ATR_LEN 28 $EQU ENCRYPT$W_FIL_COMPRESS_MAX 30 $EQU ENCRYPT$W_FIL_ENCRYPT_MAX 32 $EQU ENCRYPT$R_FIL_DCXLEN_OVERLAY 34 $EQU ENCRYPT$L_FIL_DCXMAP_LEN 34 $EQU ENCRYPT$S_FIL_DCXMAP_LEN_WORD 4 $EQU ENCRYPT$R_FIL_DCXMAP_LEN_WORD 34 $EQU ENCRYPT$W_FIL_DCXMAP_LEN_LOW 34 $EQU ENCRYPT$W_FIL_DCXMAP_LEN_HIGH 36 $EQU ENCRYPT$W_FIL_ALGNAM_LEN 38 $EQU ENCRYPT$S_FIL_ALGNAM_STR 6 $EQU ENCRYPT$T_FIL_ALGNAM_STR 40 $EQU ENCRYPT$S_FIL_XKEY 80 $EQU ENCRYPT$B_FIL_XKEY 46 $EQU ENCRYPT$S_FIL_XIV 80 $EQU ENCRYPT$B_FIL_XIV 126 $EQU ENCRYPT$W_FIL_XALGNAM_LEN 206 $EQU ENCRYPT$S_FIL_XALGNAM_STR 16 $EQU ENCRYPT$T_FIL_XALGNAM_STR 208 $EQU ENCRYPT$S_FIL_FILLER 28 $EQU ENCRYPT$B_FIL_FILLER 224 $EQU ENCRYPT$L_FIL_CHECKSUM 252 ; ; Attribute record structure in encrypted data file. The encrypted file ; attributes are obtained from the input file fab and a chain of xab ; blocks. The fab attributes are copied into a smaller structure, FABATR, ; declared below and the xab attributes are copied in toto. ; ; FILATR_LENGTH length of file attributes ; FILATR_FILL_60 unused ; FILATR mask of whats present in attrib record ; FABATR fabatr present ; XABALL xaball present ; XABDAT xabdat present ; XABFHC xabfhc present ; XABPRO xabpro present ; PROACL xabpro access control list present ; XABSUM xabsum present ; UNASSIGNED unassigned bits ; ATR_FILLER filler to pad to 256 bytes $EQU ENCRYPT$M_FABATR <^X1> $EQU ENCRYPT$M_XABALL <^X2> $EQU ENCRYPT$M_XABDAT <^X4> $EQU ENCRYPT$M_XABFHC <^X8> $EQU ENCRYPT$M_XABPRO <^X10> $EQU ENCRYPT$M_PROACL <^X20> $EQU ENCRYPT$M_XABSUM <^X40> $EQU ENCRYPT$M_UNASSIGNED <^XFFFFFF80> $EQU ENCRYPT$S_ATR_RECORD 256 $EQU ENCRYPT$W_FILATR_LENGTH 0 $EQU ENCRYPT$R_FILATR_OVERLAY 4 $EQU ENCRYPT$L_FILATR 4 $EQU ENCRYPT$R_FILATR_BITS 4 $EQU ENCRYPT$V_FABATR 0 $EQU ENCRYPT$V_XABALL 1 $EQU ENCRYPT$V_XABDAT 2 $EQU ENCRYPT$V_XABFHC 3 $EQU ENCRYPT$V_XABPRO 4 $EQU ENCRYPT$V_PROACL 5 $EQU ENCRYPT$V_XABSUM 6 $EQU ENCRYPT$S_UNASSIGNED 25 $EQU ENCRYPT$V_UNASSIGNED 7 $EQU ENCRYPT$S_ATR_FILLER 248 $EQU ENCRYPT$B_ATR_FILLER 8 ; ; While other attributes are stored as whole xabs, attributes from the ; fab are copied to the xab-like structure FAB_ATTRIBUTES. ; ; COD structure code ; BLN structure length ; fill_50 spare ; fill_51 address of next structure ; ORG file organization ; RFM record format ; RAT record attributes ; FSZ vfc header size ; BKS bucket size ; RTV retrieval pointer count ; fill_52 spare ; MRS maximum record size ; GBC global buffer count ; MRN maximum record number ; FOP file operations $EQU FABATR$S_FAB_ATTRIBUTES 28 $EQU FABATR$B_BLN 1 $EQU FABATR$B_ORG 8 $EQU FABATR$B_RFM 9 $EQU FABATR$B_RAT 10 $EQU FABATR$B_FSZ 11 $EQU FABATR$B_BKS 12 $EQU FABATR$B_RTV 13 $EQU FABATR$W_MRS 16 $EQU FABATR$W_GBC 18 $EQU FABATR$L_MRN 20 $EQU FABATR$L_FOP 24 ; EXCESS_DATA Holds data beyond plaintext EOF ; EXCESS_CRC CRC of file $EQU ENCRYPT$S_EXCESS_DATA 34 $EQU ENCRYPT$W_EXCESS_CRC 0 ; ; Feature block ; $EQU ENCRYPT$M_PRODUCT_VERSION_MIN <^XFF> $EQU ENCRYPT$M_PRODUCT_VERSION_MAJ <^XFF00> $EQU ENCRYPT$S_FEATURE 8 $EQU ENCRYPT$L_FEATURE_CODE 0 $EQU ENCRYPT$R_VERSION_OVERLAY 4 $EQU ENCRYPT$W_PRODUCT_VERSION 4 $EQU ENCRYPT$R_PV_BITS 4 $EQU ENCRYPT$S_PRODUCT_VERSION_MIN 8 $EQU ENCRYPT$V_PRODUCT_VERSION_MIN 0 $EQU ENCRYPT$S_PRODUCT_VERSION_MAJ 8 $EQU ENCRYPT$V_PRODUCT_VERSION_MAJ 8 $EQU ENCRYPT$W_FEATURE_LENGTH 6 $EQU ENCRYPT$T_FEATURE_VALUE 8 $EQU ENCRYPT$M_FTR_REQUIRED <^X1> $EQU ENCRYPT$M_FTR_COMMENT <^X2> $EQU ENCRYPT$M_FTR_DEBUG <^X4> $EQU ENCRYPT$M_FTR_SILENT <^X8> $EQU ENCRYPT$V_FTR_REQUIRED 0 $EQU ENCRYPT$V_FTR_COMMENT 1 $EQU ENCRYPT$V_FTR_DEBUG 2 $EQU ENCRYPT$V_FTR_SILENT 3 $EQU ENCRYPT$S_FTR_NUMBER 12 $EQU ENCRYPT$V_FTR_NUMBER 4 ; ; CRC checking feature block value definitions ; $EQU ENCRYPT$K_FEATURE_CRC 33 ; ; Semantic tag feature block value definitions ; $EQU ENCRYPT$K_FEATURE_SEMTAG 17 $EQU ENCRYPT$S_FEATURE_SEMTAG_ 66 $EQU ENCRYPT$W_SEMTAG_LENGTH 0 $EQU ENCRYPT$S_SEMTAG_VALUE 64 $EQU ENCRYPT$T_SEMTAG_VALUE 2 $EQU ENCRYPT$K_FEATURES_MAX_LEN 86 ; ; Define the encrypted file structure version of the current implementation ; ; Bumped FILE_VERSION for Encrypt-AES from 3 to 4 ; $EQU ENCRYPT$K_FILE_VERSION 4 ; ; Statistics record returned by encrypt$statistics() ; $EQU ENCRYPT$S_STAT_RECORD 28 ; ; Format returned for statistics type code = 1 ; ; STAT_TOTAL_RECORDS statistics: total records ; STAT_TOTAL_BYTES statistics: total bytes through stream ; STAT_TOTAL_TIME statistics: total time in facility ; STAT_FILL_10 statistics: expansion $EQU ENCRYPT$L_STAT_TOTAL_RECORDS 0 $EQU ENCRYPT$S_STAT_TOTAL_BYTES 8 $EQU ENCRYPT$Q_STAT_TOTAL_BYTES 4 $EQU ENCRYPT$S_STAT_TOTAL_TIME 8 $EQU ENCRYPT$Q_STAT_TOTAL_TIME 12 $DEFEND ENCSTR,$GBL,DEF .ENDM