1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _PACKAGE_CONSTANTS_HXX_
24 #define _PACKAGE_CONSTANTS_HXX_
25 
26 #include <sal/types.h>
27 
28 const sal_Int32 n_ConstBufferSize = 32768;
29 const sal_Int32 n_ConstMaxMemoryStreamSize = 20480;
30 
31 // by calculation of the digest we read 32 bytes more ( if available )
32 // it allows to ignore the padding if the stream is longer than n_ConstDigestDecrypt since we read at least two blocks more;
33 // if the stream is shorter or equal the padding will be done successfully
34 const sal_Int32 n_ConstDigestLength = 1024;
35 const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32
36 
37 // the constants related to the manifest.xml entries
38 #define PKG_MNFST_MEDIATYPE   0
39 #define PKG_MNFST_VERSION     1
40 #define PKG_MNFST_FULLPATH    2
41 
42 #define PKG_MNFST_INIVECTOR   3
43 #define PKG_MNFST_SALT        4
44 #define PKG_MNFST_ITERATION   5
45 #define PKG_MNFST_UCOMPSIZE   6
46 #define PKG_MNFST_DIGEST      7
47 #define PKG_MNFST_ENCALG      8
48 #define PKG_MNFST_STARTALG    9
49 #define PKG_MNFST_DIGESTALG  10
50 #define PKG_MNFST_DERKEYSIZE 11
51 
52 #define PKG_SIZE_NOENCR_MNFST 3
53 #define PKG_SIZE_ENCR_MNFST   12
54 
55 // the properties related constants
56 #define ENCRYPTION_KEY_PROPERTY "EncryptionKey"
57 #define STORAGE_ENCRYPTION_KEYS_PROPERTY "StorageEncryptionKeys"
58 #define ENCRYPTION_ALGORITHMS_PROPERTY "EncryptionAlgorithms"
59 #define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries"
60 #define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries"
61 #define IS_INCONSISTENT_PROPERTY "IsInconsistent"
62 #define MEDIATYPE_FALLBACK_USED_PROPERTY "MediaTypeFallbackUsed"
63 
64 
65 #endif
66 
67