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