Path: blob/master/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11gcm2.h
41152 views
/*1* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/* There is a known incompatibility for CK_GCM_PARAMS structure.26* PKCS#11 v2.40 standard mechanisms specification specifies27* CK_GCM_PARAMS as28* typedef struct CK_GCM_PARAMS {29* CK_BYTE_PTR pIv;30* CK_ULONG ulIvLen;31* CK_BYTE_PTR pAAD;32* CK_ULONG ulAADLen;33* CK_ULONG ulTagBits;34* } CK_GCM_PARAMS;35* However, the official header file of PKCS#11 v2.40 defines the36* CK_GCM_PARAMS with an extra "ulIvBits" field (type CK_ULONG).37* NSS uses the spec version while Solaris and SoftHSM2 use the header38* version. In order to work with both sides, SunPKCS11 provider defines39* the spec version of CK_GCM_PARAMS as CK_GCM_PARAMS_NO_IVBITS (as in this40* file) and uses it first before failing over to the header version.41*/42#ifndef _PKCS11GCM2_H_43#define _PKCS11GCM2_H_ 14445/* include the platform dependent part of the header */46typedef struct CK_GCM_PARAMS_NO_IVBITS {47CK_BYTE_PTR pIv;48CK_ULONG ulIvLen;49CK_BYTE_PTR pAAD;50CK_ULONG ulAADLen;51CK_ULONG ulTagBits;52} CK_GCM_PARAMS_NO_IVBITS;5354typedef CK_GCM_PARAMS_NO_IVBITS CK_PTR CK_GCM_PARAMS_NO_IVBITS_PTR;5556#endif /* _PKCS11GCM2_H_ */575859