You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/14 15:41:00 UTC

[jira] [Commented] (PARQUET-1301) [C++] Crypto package in parquet-cpp

    [ https://issues.apache.org/jira/browse/PARQUET-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16512629#comment-16512629 ] 

ASF GitHub Bot commented on PARQUET-1301:
-----------------------------------------

jamesclampffer commented on a change in pull request #464: PARQUET-1301: [C++] Crypto package in parquet-cpp
URL: https://github.com/apache/parquet-cpp/pull/464#discussion_r195457115
 
 

 ##########
 File path: src/parquet/util/crypto.h
 ##########
 @@ -0,0 +1,240 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+
+#ifndef PARQUET_UTIL_CRYPTO_H
+#define PARQUET_UTIL_CRYPTO_H
+
+#include <openssl/aes.h>
+#include <openssl/evp.h>
+#include <openssl/rand.h>
+#include <string>
+#include <sstream>
+#include <iostream>
+#include "parquet/exception.h"
+#include "parquet/types.h" 
+
+namespace parquet {
+ 
+inline int encrypt(Encryption::type alg_id, const uint8_t *plaintext, int plaintext_len, 
+                   uint8_t *key, int key_len, uint8_t *aad, int aad_len, 
+                   uint8_t *ciphertext) {
+                   
+  if (Encryption::PARQUET_AES_GCM_V1 != alg_id) {
+    std::stringstream ss;
+    ss << "Crypto algorithm " << alg_id << " currently unsupported\n";
 
 Review comment:
   Nit: remove the trailing newline in the exception descriptions to be consistent with other error strings.

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


> [C++] Crypto package in parquet-cpp
> -----------------------------------
>
>                 Key: PARQUET-1301
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1301
>             Project: Parquet
>          Issue Type: Sub-task
>          Components: parquet-cpp
>            Reporter: Gidon Gershinsky
>            Assignee: Gidon Gershinsky
>            Priority: Major
>
> The C++ implementation of basic AES-GCM encryption and decryption



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)