1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _PACKAGE_CONSTANTS_HXX_
20 #define _PACKAGE_CONSTANTS_HXX_
22 #include <sal/types.h>
24 const sal_Int32 n_ConstBufferSize
= 32768;
25 const sal_Int32 n_ConstMaxMemoryStreamSize
= 20480;
27 // by calculation of the digest we read 32 bytes more ( if available )
28 // it allows to ignore the padding if the stream is longer than n_ConstDigestDecrypt since we read at least two blocks more;
29 // if the stream is shorter or equal the padding will be done successfully
30 const sal_Int32 n_ConstDigestLength
= 1024;
31 const sal_Int32 n_ConstDigestDecrypt
= 1056; // 1024 + 32
33 // the constants related to the manifest.xml entries
34 #define PKG_MNFST_FULLPATH 0 //FullPath (Put full-path property first for MBA)
35 #define PKG_MNFST_VERSION 1 //Version
36 #define PKG_MNFST_MEDIATYPE 2 //MediaType
38 #define PKG_MNFST_INIVECTOR 3 //InitialisationVector
39 #define PKG_MNFST_SALT 4 //Salt
40 #define PKG_MNFST_ITERATION 5 //IterationCount
41 #define PKG_MNFST_UCOMPSIZE 6 //Size
42 #define PKG_MNFST_DIGEST 7 //Digest
43 #define PKG_MNFST_ENCALG 8 //EncryptionAlgorithm
44 #define PKG_MNFST_STARTALG 9 //StartKeyAlgorithm
45 #define PKG_MNFST_DIGESTALG 10 //DigestAlgorithm
46 #define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize
48 #define PKG_SIZE_NOENCR_MNFST 3
49 #define PKG_SIZE_ENCR_MNFST 12
51 // the properties related constants
52 #define ENCRYPTION_KEY_PROPERTY "EncryptionKey"
53 #define STORAGE_ENCRYPTION_KEYS_PROPERTY "StorageEncryptionKeys"
54 #define ENCRYPTION_ALGORITHMS_PROPERTY "EncryptionAlgorithms"
55 #define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries"
56 #define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries"
57 #define IS_INCONSISTENT_PROPERTY "IsInconsistent"
58 #define MEDIATYPE_FALLBACK_USED_PROPERTY "MediaTypeFallbackUsed"
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */