+++ /dev/null
-/*
- * 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
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <openssl/crypto.h>
#include <yaca/crypto.h>
#include <yaca/error.h>
-#include "ctx_p.h"
+#include "internal.h"
API int yaca_init(void)
{
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <stdint.h>
#include <yaca/error.h>
#include <yaca/types.h>
-#include "ctx_p.h"
+#include "internal.h"
struct yaca_digest_ctx_s
{
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <openssl/crypto.h>
#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,
* 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,
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
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
-#include "key_p.h"
+#include "internal.h"
/**
* Internal type for:
+++ /dev/null
-/*
- * 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 */
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <openssl/crypto.h>
#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)
* limitations under the License
*/
-#include "config.h"
-
#include <assert.h>
#include <limits.h>
#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,