This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
     new e58cc27  Javadoc.
e58cc27 is described below

commit e58cc27f74173771f3eec3d2a1590b1b045569f9
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Mar 17 09:47:52 2022 -0400

    Javadoc.
---
 .../commons/crypto/cipher/OpenSslGaloisCounterMode.java   | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/crypto/cipher/OpenSslGaloisCounterMode.java 
b/src/main/java/org/apache/commons/crypto/cipher/OpenSslGaloisCounterMode.java
index cb3e23c..d8b8de4 100644
--- 
a/src/main/java/org/apache/commons/crypto/cipher/OpenSslGaloisCounterMode.java
+++ 
b/src/main/java/org/apache/commons/crypto/cipher/OpenSslGaloisCounterMode.java
@@ -292,18 +292,23 @@ class OpenSslGaloisCounterMode extends 
OpenSslFeedbackCipher {
     }
 
     /**
-     * a wrapper of OpenSslNative.ctrl(long context, int type, int arg, byte[] 
data)
+     * Wraps of OpenSslNative.ctrl(long context, int type, int arg, byte[] 
data)
      * Since native interface EVP_CIPHER_CTX *ctx, int type, int arg, void 
*ptr) is generic,
      * it may set/get any native char or long type to the data buffer(ptr).
      * Here we use ByteBuffer and set nativeOrder to handle the endianness.
+     *
+     * @param context The cipher context address
+     * @param type CtrlValues
+     * @param arg argument like a tag length
+     * @param data byte buffer or null
      */
-    private void evpCipherCtxCtrl(final long context, final int type, final 
int arg, final ByteBuffer bb) {
+    private void evpCipherCtxCtrl(final long context, final int type, final 
int arg, final ByteBuffer data) {
         checkState();
 
         try {
-            if (bb != null) {
-                bb.order(ByteOrder.nativeOrder());
-                OpenSslNative.ctrl(context, type, arg, bb.array());
+            if (data != null) {
+                data.order(ByteOrder.nativeOrder());
+                OpenSslNative.ctrl(context, type, arg, data.array());
             } else {
                 OpenSslNative.ctrl(context, type, arg, null);
             }

Reply via email to