workaround segfault in compiler on macos-clang-intel
[LibreOffice.git] / package / inc / PackageConstants.hxx
blob15cc4d3ee9b019b0f4c1e1bc28fb6b11ca446f71
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_PACKAGE_INC_PACKAGECONSTANTS_HXX
20 #define INCLUDED_PACKAGE_INC_PACKAGECONSTANTS_HXX
22 #include <sal/types.h>
23 #include <rtl/ustring.hxx>
25 const sal_Int32 n_ConstBufferSize = 32768;
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 // these primarily exist so that ManifestImport can directly write into Sequence
35 #define PKG_MNFST_FULLPATH 0 //FullPath (Put full-path property first for MBA)
36 #define PKG_MNFST_VERSION 1 //Version
37 #define PKG_MNFST_MEDIATYPE 2 //MediaType
39 #define PKG_MNFST_INIVECTOR 3 //InitialisationVector
40 #define PKG_MNFST_SALT 4 //Salt
41 #define PKG_MNFST_ITERATION 5 //IterationCount
42 #define PKG_MNFST_UCOMPSIZE 6 //Size
43 #define PKG_MNFST_DIGEST 7 //Digest
44 #define PKG_MNFST_ENCALG 8 //EncryptionAlgorithm
45 #define PKG_MNFST_STARTALG 9 //StartKeyAlgorithm
46 #define PKG_MNFST_DIGESTALG 10 //DigestAlgorithm
47 #define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize
48 #define PKG_MNFST_KDF 12 // KeyDerivationFunction
49 #define PKG_MNFST_ARGON2ARGS 13 // Argon2 arguments
50 #define PKG_MNFST_KEYINFO 14 // PGP KeyInfo
52 #define PKG_SIZE_NOENCR_MNFST 3
53 #define PKG_SIZE_ENCR_MNFST 15 // max size
55 // the properties related constants
56 inline constexpr OUString ENCRYPTION_KEY_PROPERTY = u"EncryptionKey"_ustr;
57 inline constexpr OUString STORAGE_ENCRYPTION_KEYS_PROPERTY = u"StorageEncryptionKeys"_ustr;
58 inline constexpr OUString ENCRYPTION_ALGORITHMS_PROPERTY = u"EncryptionAlgorithms"_ustr;
59 inline constexpr OUString ENCRYPTION_GPG_PROPERTIES = u"EncryptionGpGProperties"_ustr;
60 #define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries"
61 #define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries"
62 #define IS_INCONSISTENT_PROPERTY "IsInconsistent"
63 inline constexpr OUString MEDIATYPE_FALLBACK_USED_PROPERTY = u"MediaTypeFallbackUsed"_ustr;
65 #endif
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */