Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11gcm2.h
41152 views
1
/*
2
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
/* There is a known incompatibility for CK_GCM_PARAMS structure.
27
* PKCS#11 v2.40 standard mechanisms specification specifies
28
* CK_GCM_PARAMS as
29
* typedef struct CK_GCM_PARAMS {
30
* CK_BYTE_PTR pIv;
31
* CK_ULONG ulIvLen;
32
* CK_BYTE_PTR pAAD;
33
* CK_ULONG ulAADLen;
34
* CK_ULONG ulTagBits;
35
* } CK_GCM_PARAMS;
36
* However, the official header file of PKCS#11 v2.40 defines the
37
* CK_GCM_PARAMS with an extra "ulIvBits" field (type CK_ULONG).
38
* NSS uses the spec version while Solaris and SoftHSM2 use the header
39
* version. In order to work with both sides, SunPKCS11 provider defines
40
* the spec version of CK_GCM_PARAMS as CK_GCM_PARAMS_NO_IVBITS (as in this
41
* file) and uses it first before failing over to the header version.
42
*/
43
#ifndef _PKCS11GCM2_H_
44
#define _PKCS11GCM2_H_ 1
45
46
/* include the platform dependent part of the header */
47
typedef struct CK_GCM_PARAMS_NO_IVBITS {
48
CK_BYTE_PTR pIv;
49
CK_ULONG ulIvLen;
50
CK_BYTE_PTR pAAD;
51
CK_ULONG ulAADLen;
52
CK_ULONG ulTagBits;
53
} CK_GCM_PARAMS_NO_IVBITS;
54
55
typedef CK_GCM_PARAMS_NO_IVBITS CK_PTR CK_GCM_PARAMS_NO_IVBITS_PTR;
56
57
#endif /* _PKCS11GCM2_H_ */
58
59