Remove private headers (*_p.h)
authorMateusz Kulikowski <m.kulikowski@samsung.com>
Thu, 7 Apr 2016 14:37:21 +0000 (16:37 +0200)
committerMateusz Kulikowski <m.kulikowski@samsung.com>
Fri, 8 Apr 2016 11:26:23 +0000 (13:26 +0200)
Merge all internal defines / macros / declarations into internal.h

This file may be later split, but for now it's small enough.

Change-Id: I5f00c856fd7daa0773fd6ccdb175312df1e06818
Signed-off-by: Mateusz Kulikowski <m.kulikowski@samsung.com>
src/config.h [deleted file]
src/crypto.c
src/digest.c
src/encrypt.c
src/internal.h [moved from src/ctx_p.h with 77% similarity]
src/key.c
src/key_p.h [deleted file]
src/sign.c
src/simple.c

diff --git a/src/config.h b/src/config.h
deleted file mode 100644 (file)
index bc99feb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Contact: Krzysztof Jackiewicz <k.jackiewicz@samsung.com>
- *
- *  Licensed 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 CONFIG_H
-#define CONFIG_H
-
-#define API __attribute__ ((visibility ("default")))
-
-#endif // CONFIG_H
index dd24974..74c3f12 100644 (file)
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 
 #include <openssl/crypto.h>
@@ -27,7 +25,7 @@
 #include <yaca/crypto.h>
 #include <yaca/error.h>
 
-#include "ctx_p.h"
+#include "internal.h"
 
 API int yaca_init(void)
 {
index d37d03f..f0acd71 100644 (file)
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 #include <stdint.h>
 
@@ -28,7 +26,7 @@
 #include <yaca/error.h>
 #include <yaca/types.h>
 
-#include "ctx_p.h"
+#include "internal.h"
 
 struct yaca_digest_ctx_s
 {
index 427707a..ca8fa1d 100644 (file)
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 
 #include <openssl/crypto.h>
@@ -26,6 +24,8 @@
 #include <yaca/crypto.h>
 #include <yaca/error.h>
 
+#include "internal.h"
+
 API int yaca_encrypt_init(yaca_ctx_h *ctx,
                          yaca_enc_algo_e algo,
                          yaca_block_cipher_mode_e bcm,
similarity index 77%
rename from src/ctx_p.h
rename to src/internal.h
index c8da49e..ea7d0ab 100644 (file)
  *  limitations under the License
  */
 
-#ifndef CTX_P_H
-#define CTX_P_H
+/**
+ * @file encrypt.h
+ * @brief Internal API
+ */
+
+#ifndef INTERNAL_H
+#define INTERNAL_H
 
 #include <stddef.h>
+
 #include <yaca/types.h>
 
+#define API __attribute__ ((visibility ("default")))
+
 enum yaca_ctx_type_e
 {
        YACA_CTX_INVALID = 0,
@@ -37,4 +45,13 @@ struct yaca_ctx_s
        int (*get_output_length)(const yaca_ctx_h ctx, size_t input_len);
 };
 
-#endif // CTX_P_H
+
+/* Base structure for crypto keys - to be inherited */
+struct yaca_key_s
+{
+       yaca_key_type_e type;
+
+       int (*get_key_length)(const struct yaca_key_s *key);
+};
+
+#endif
index 2c70db8..e230156 100644 (file)
--- a/src/key.c
+++ b/src/key.c
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
@@ -31,7 +29,7 @@
 #include <openssl/evp.h>
 #include <openssl/rsa.h>
 
-#include "key_p.h"
+#include "internal.h"
 
 /**
  * Internal type for:
diff --git a/src/key_p.h b/src/key_p.h
deleted file mode 100644 (file)
index a431116..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Contact: Krzysztof Jackiewicz <k.jackiewicz@samsung.com>
- *
- *  Licensed 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 KEY_P_H
-#define KEY_P_H
-
-#include <stdlib.h>
-#include <yaca/types.h>
-
-/**
- * @file key_p.h
- * @brief Private header for key.c
- */
-
-/* Base structure for crypto keys - to be inherited */
-struct yaca_key_s
-{
-       yaca_key_type_e type;
-};
-
-#endif /* KEY_P_H */
index 955a23b..2f37c0f 100644 (file)
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 
 #include <openssl/crypto.h>
@@ -26,6 +24,8 @@
 #include <yaca/crypto.h>
 #include <yaca/error.h>
 
+#include "internal.h"
+
 API int yaca_sign_init(yaca_ctx_h *ctx,
                       yaca_digest_algo_e algo,
                       const yaca_key_h key)
index 312804e..ce1d5f3 100644 (file)
@@ -16,8 +16,6 @@
  *  limitations under the License
  */
 
-#include "config.h"
-
 #include <assert.h>
 #include <limits.h>
 
@@ -30,6 +28,8 @@
 #include <yaca/digest.h>
 #include <yaca/key.h>
 
+#include "internal.h"
+
 API int yaca_digest_calc(yaca_digest_algo_e algo,
                         const char *data,
                         size_t data_len,