< prev index next >

jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java

Print this page




  23  * questions.
  24  */
  25 
  26 package com.oracle.security.ucrypto;
  27 
  28 import java.io.ByteArrayOutputStream;
  29 import java.nio.ByteBuffer;
  30 
  31 import java.util.Set;
  32 import java.util.Arrays;
  33 import java.security.*;
  34 import java.security.spec.*;
  35 import javax.crypto.*;
  36 import javax.crypto.spec.SecretKeySpec;
  37 import javax.crypto.spec.GCMParameterSpec;
  38 
  39 /**
  40  * Cipher wrapper class utilizing ucrypto APIs. This class currently supports
  41  * - AES/GCM/NoPADDING
  42  *
  43  * @since 1.9
  44  */
  45 class NativeGCMCipher extends NativeCipher {
  46 
  47     public static final class AesGcmNoPadding extends NativeGCMCipher {
  48         public AesGcmNoPadding() throws NoSuchAlgorithmException {
  49             super(-1);
  50         }
  51         public AesGcmNoPadding(int keySize) throws NoSuchAlgorithmException {
  52             super(keySize);
  53         }
  54     }
  55 
  56     private static final int DEFAULT_TAG_LEN = 128; // same as SunJCE provider
  57 
  58     // buffer for storing AAD data; if null, meaning buffer content has been
  59     // supplied to native context
  60     private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream();
  61 
  62     // buffer for storing input in decryption, not used for encryption
  63     private ByteArrayOutputStream ibuffer = null;




  23  * questions.
  24  */
  25 
  26 package com.oracle.security.ucrypto;
  27 
  28 import java.io.ByteArrayOutputStream;
  29 import java.nio.ByteBuffer;
  30 
  31 import java.util.Set;
  32 import java.util.Arrays;
  33 import java.security.*;
  34 import java.security.spec.*;
  35 import javax.crypto.*;
  36 import javax.crypto.spec.SecretKeySpec;
  37 import javax.crypto.spec.GCMParameterSpec;
  38 
  39 /**
  40  * Cipher wrapper class utilizing ucrypto APIs. This class currently supports
  41  * - AES/GCM/NoPADDING
  42  *
  43  * @since 9
  44  */
  45 class NativeGCMCipher extends NativeCipher {
  46 
  47     public static final class AesGcmNoPadding extends NativeGCMCipher {
  48         public AesGcmNoPadding() throws NoSuchAlgorithmException {
  49             super(-1);
  50         }
  51         public AesGcmNoPadding(int keySize) throws NoSuchAlgorithmException {
  52             super(keySize);
  53         }
  54     }
  55 
  56     private static final int DEFAULT_TAG_LEN = 128; // same as SunJCE provider
  57 
  58     // buffer for storing AAD data; if null, meaning buffer content has been
  59     // supplied to native context
  60     private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream();
  61 
  62     // buffer for storing input in decryption, not used for encryption
  63     private ByteArrayOutputStream ibuffer = null;


< prev index next >