atoulme commented on a change in pull request #38: v5 UDP packet handling
URL: https://github.com/apache/incubator-tuweni/pull/38#discussion_r337667185
 
 

 ##########
 File path: 
devp2p/src/main/kotlin/org/apache/tuweni/devp2p/v5/encrypt/AES128GCM.kt
 ##########
 @@ -0,0 +1,56 @@
+package org.apache.tuweni.devp2p.v5.encrypt
+
+import org.apache.tuweni.bytes.Bytes
+import java.nio.ByteBuffer
+import javax.crypto.Cipher
+import javax.crypto.spec.GCMParameterSpec
+import javax.crypto.spec.SecretKeySpec
+
+object AES128GCM {
+
+  fun encrypt(key: Bytes, nonce: Bytes, message: Bytes, data: Bytes): Bytes {
+    val result = encrypt(nonce.toArray(), key.toArray(), data.toArray(), 
message.toArray())
+    return Bytes.wrap(result)
+  }
+
+  fun encrypt(key: ByteArray, nonce: ByteArray, message: ByteArray, data: 
ByteArray): ByteArray {
 
 Review comment:
   Please make it return a Bytes object.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to