AWS Encryption SDK for C v2.4
Loading...
Searching...
No Matches
cipher.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. A copy of the License is
6 * located at
7 *
8 * http://aws.amazon.com/apache2.0/
9 *
10 * or in the "license" file accompanying this file. This file is distributed on an
11 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 * implied. See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef AWS_CRYPTOSDK_CIPHER_H
17#define AWS_CRYPTOSDK_CIPHER_H
18
19#include <aws/common/byte_buf.h>
20#include <aws/common/string.h>
21#include <aws/cryptosdk/exports.h>
23
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
40
47
56 const char *md_name;
58 const char *cipher_name;
60 const char *alg_name;
61
67 const struct aws_cryptosdk_alg_impl *impl;
68
77 size_t iv_len;
83 size_t tag_len;
89
94
99
104
110
112 const char *sig_md_name;
113};
114
120AWS_CRYPTOSDK_API
122
126AWS_CRYPTOSDK_API
128
132struct aws_cryptosdk_sig_ctx;
133
137AWS_CRYPTOSDK_API
138bool aws_cryptosdk_sig_ctx_is_valid(const struct aws_cryptosdk_sig_ctx *sig_ctx);
139
146AWS_CRYPTOSDK_API
148 const struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **priv_key_buf);
149
156AWS_CRYPTOSDK_API
158 const struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **pub_key_buf);
159
171AWS_CRYPTOSDK_API
173 struct aws_cryptosdk_sig_ctx **ctx,
174 struct aws_allocator *alloc,
175 struct aws_string **pub_key_buf,
176 const struct aws_cryptosdk_alg_properties *props);
177
189AWS_CRYPTOSDK_API
191 struct aws_cryptosdk_sig_ctx **ctx,
192 struct aws_allocator *alloc,
193 struct aws_string **pub_key_buf,
194 const struct aws_cryptosdk_alg_properties *props,
195 const struct aws_string *priv_key);
196
206AWS_CRYPTOSDK_API
208 struct aws_cryptosdk_sig_ctx **ctx,
209 struct aws_allocator *alloc,
210 const struct aws_string *pub_key,
211 const struct aws_cryptosdk_alg_properties *props);
212
216AWS_CRYPTOSDK_API
217int aws_cryptosdk_sig_update(struct aws_cryptosdk_sig_ctx *ctx, const struct aws_byte_cursor buf);
218
229AWS_CRYPTOSDK_API
230int aws_cryptosdk_sig_verify_finish(struct aws_cryptosdk_sig_ctx *ctx, const struct aws_string *signature);
231
241AWS_CRYPTOSDK_API
243 struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **signature);
244
249AWS_CRYPTOSDK_API
250void aws_cryptosdk_sig_abort(struct aws_cryptosdk_sig_ctx *ctx);
251
252#ifdef __cplusplus
253}
254#endif
255 // doxygen group hazmat
257
258#endif // AWS_CRYPTOSDK_CIPHER_H
bool aws_cryptosdk_sig_ctx_is_valid(const struct aws_cryptosdk_sig_ctx *sig_ctx)
bool aws_cryptosdk_alg_properties_is_valid(const struct aws_cryptosdk_alg_properties *const alg_props)
int aws_cryptosdk_sig_get_privkey(const struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **priv_key_buf)
void aws_cryptosdk_sig_abort(struct aws_cryptosdk_sig_ctx *ctx)
const struct aws_cryptosdk_alg_properties * aws_cryptosdk_alg_props(enum aws_cryptosdk_alg_id alg_id)
int aws_cryptosdk_sig_verify_finish(struct aws_cryptosdk_sig_ctx *ctx, const struct aws_string *signature)
int aws_cryptosdk_sig_update(struct aws_cryptosdk_sig_ctx *ctx, const struct aws_byte_cursor buf)
int aws_cryptosdk_sig_get_pubkey(const struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **pub_key_buf)
int aws_cryptosdk_sig_sign_start_keygen(struct aws_cryptosdk_sig_ctx **ctx, struct aws_allocator *alloc, struct aws_string **pub_key_buf, const struct aws_cryptosdk_alg_properties *props)
int aws_cryptosdk_sig_sign_start(struct aws_cryptosdk_sig_ctx **ctx, struct aws_allocator *alloc, struct aws_string **pub_key_buf, const struct aws_cryptosdk_alg_properties *props, const struct aws_string *priv_key)
int aws_cryptosdk_sig_verify_start(struct aws_cryptosdk_sig_ctx **ctx, struct aws_allocator *alloc, const struct aws_string *pub_key, const struct aws_cryptosdk_alg_properties *props)
int aws_cryptosdk_sig_sign_finish(struct aws_cryptosdk_sig_ctx *ctx, struct aws_allocator *alloc, struct aws_string **signature)
aws_cryptosdk_aes_key_len
Definition cipher.h:35
aws_cryptosdk_rsa_padding_mode
Definition cipher.h:42
@ AWS_CRYPTOSDK_AES256
Definition cipher.h:38
@ AWS_CRYPTOSDK_AES128
Definition cipher.h:36
@ AWS_CRYPTOSDK_AES192
Definition cipher.h:37
@ AWS_CRYPTOSDK_RSA_PKCS1
Definition cipher.h:43
@ AWS_CRYPTOSDK_RSA_OAEP_SHA256_MGF1
Definition cipher.h:45
@ AWS_CRYPTOSDK_RSA_OAEP_SHA1_MGF1
Definition cipher.h:44
aws_cryptosdk_alg_id
Definition header.h:26
aws_cryptosdk_hdr_version
Definition header.h:40
const char * cipher_name
Definition cipher.h:58
enum aws_cryptosdk_hdr_version msg_format_version
Definition cipher.h:98
enum aws_cryptosdk_alg_id alg_id
Definition cipher.h:93
const struct aws_cryptosdk_alg_impl * impl
Definition cipher.h:67