< prev index next >

src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -307,11 +307,12 @@
 }
 
 ////////////////////////////////////////////////////////
 // SPECIAL ENTRIES FOR JVM JNI-BYPASSING OPTIMIZATION
 ////////////////////////////////////////////////////////
-jlong JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit(jint mech) {
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit(jint mech) {
   crypto_ctx_t *context = NULL;
   int rv;
 
   context = malloc(sizeof(crypto_ctx_t));
   if (context != NULL) {

@@ -323,11 +324,12 @@
     }
   }
   return (jlong) context;
 }
 
-jint JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate
   (jint mech, jlong pContext, int notUsed, unsigned char* in, jint ofs, jint len) {
   crypto_ctx_t *context;
   jint rv = 0;
 
   context = (crypto_ctx_t *) pContext;

@@ -340,11 +342,12 @@
   }
 
   return -rv; // use negative value to indicate error
 }
 
-jint JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest
   (jint mech, jlong pContext, int notUsed, unsigned char* out, jint ofs, jint digestLen) {
   crypto_ctx_t *context;
   jint rv = 0;
   size_t digest_len = digestLen;
 

@@ -357,20 +360,22 @@
   }
 
   return -rv; // use negative value to indicate error
 }
 
-void JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree
+JNIEXPORT void JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree
   (jint mech, jlong pContext) {
   crypto_ctx_t *context;
 
   context = (crypto_ctx_t *) pContext;
   freeContext(context);
 }
 
 // AES
-jlong JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit
   (jint mech, jboolean encrypt, int keyLen, unsigned char* bufKey,
    int ivLen, unsigned char* bufIv, jint tagLen, int aadLen, unsigned char* bufAad) {
   crypto_ctx_t *context = NULL;
   int rv;
 

@@ -389,11 +394,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeCipher
  * Method:    nativeUpdate
  * Signature: (JZ[BII[BI)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate
   (jlong pContext, jboolean encrypt, int notUsed, jbyte* bufIn, jint inOfs, jint inLen,
    int outCapacity, jbyte* bufOut, jint outOfs) {
   crypto_ctx_t *context;
   int rv = 0;
   int outLen = outCapacity - outOfs; // recalculate the real out length

@@ -411,11 +417,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeCipher
  * Method:    nativeFinal
  * Signature: (JZ[BI)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal
   (jlong pContext, jboolean encrypt, int outLen, jbyte* out, jint outOfs) {
   crypto_ctx_t *context;
   int rv = 0;
   unsigned char* bufOut = (unsigned char*) out;
 

@@ -662,11 +669,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeKey
  * Method:    nativeFree
  * Signature: (JI)V
  */
-void JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree
+JNIEXPORT void JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree
   (jlong id, jint numOfComponents) {
   crypto_object_attribute_t* pKey;
   int i;
 
   pKey = (crypto_object_attribute_t*) id;

@@ -684,11 +692,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeKey_RSAPrivate
  * Method:    nativeInit
  * Signature: ([B[B)J
  */
-jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivate_nativeInit
 (int modLen, jbyte* jMod, int privLen, jbyte* jPriv) {
 
   unsigned char *mod, *priv;
   crypto_object_attribute_t* pKey = NULL;
 

@@ -764,11 +773,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeKey_RSAPrivateCrt
  * Method:    nativeInit
  * Signature: ([B[B[B[B[B[B[B[B)J
  */
-jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit
 (int modLen, jbyte* jMod, int pubLen, jbyte* jPub, int privLen, jbyte* jPriv,
  int pLen, jbyte* jP, int qLen, jbyte* jQ, int expPLen, jbyte* jExpP,
  int expQLen, jbyte* jExpQ, int crtCoeffLen, jbyte* jCrtCoeff) {
 
   unsigned char *mod, *pub, *priv, *p, *q, *expP, *expQ, *crtCoeff;

@@ -935,11 +945,12 @@
  * Class:     com_oracle_security_ucrypto_NativeKey_RSAPublic
  * Method:    nativeInit
  * Signature: ([B[B)J
  */
 
-jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit
 (int modLen, jbyte* jMod, int pubLen, jbyte* jPub) {
   unsigned char *mod, *pub;
   crypto_object_attribute_t* pKey = NULL;
 
   pKey = calloc(2, sizeof(crypto_object_attribute_t));

@@ -1046,11 +1057,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeRSASignature
  * Method:    nativeInit
  * Signature: (IZJI[B)J
  */
-jlong JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit
+JNIEXPORT jlong JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit
 (jint mech, jboolean sign, jlong jKey, jint keyLength) {
   crypto_ctx_t *context;
   int rv;
   uchar_t *pKey;
 

@@ -1092,11 +1104,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeRSASignature
  * Method:    nativeUpdate
  * Signature: (JZ[BII)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
 (jlong pCtxt, jboolean sign, int notUsed, jbyte* jIn, jint jInOfs, jint jInLen) {
   crypto_ctx_t *context;
   int rv = 0;
 
   context = (crypto_ctx_t *) pCtxt;

@@ -1140,11 +1153,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeRSASignature
  * Method:    nativeUpdate
  * Signature: (JZJI)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI
 (jlong pCtxt, jboolean sign, jlong inAddr, jint inLen) {
 
   return JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
     (pCtxt, sign, inLen, (jbyte*)inAddr, 0, inLen);
 }

@@ -1159,11 +1173,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeRSASignature
  * Method:    nativeFinal
  * Signature: (JZ[BII)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal
 (jlong pCtxt, jboolean sign, int notUsed, jbyte* bufSig, jint sigOfs, jint jSigLen) {
 
   crypto_ctx_t *context;
   int rv = 0;
   size_t sigLength = (size_t) jSigLen;

@@ -1234,11 +1249,12 @@
 /*
  * Class:     com_oracle_security_ucrypto_NativeRSACipher
  * Method:    nativeAtomic
  * Signature: (IZJI[BI[BII)I
  */
-jint JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic
+JNIEXPORT jint JNICALL
+JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic
   (jint mech, jboolean encrypt, jlong keyValue, jint keyLength,
    int notUsed1, jbyte* bufIn, jint jInLen,
    int notUsed2, jbyte* bufOut, jint jOutOfs, jint jOutLen) {
 
   uchar_t *pKey;
< prev index next >