3 Counter with CBC-MAC mode using AES192 as the underlying cipher.
5 Copyright (C) 2014 Exegin Technologies Limited
6 Copyright (C) 2014 Owen Kirby
8 This file is part of GNU Nettle.
10 GNU Nettle is free software: you can redistribute it and/or
11 modify it under the terms of either:
13 * the GNU Lesser General Public License as published by the Free
14 Software Foundation; either version 3 of the License, or (at your
15 option) any later version.
19 * the GNU General Public License as published by the Free
20 Software Foundation; either version 2 of the License, or (at your
21 option) any later version.
23 or both in parallel, as here.
25 GNU Nettle is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 General Public License for more details.
30 You should have received copies of the GNU General Public License and
31 the GNU Lesser General Public License along with this program. If
32 not, see http://www.gnu.org/licenses/.
46 ccm_aes192_set_key(struct ccm_aes192_ctx *ctx, const uint8_t *key)
48 aes192_set_encrypt_key(&ctx->cipher, key);
52 ccm_aes192_set_nonce(struct ccm_aes192_ctx *ctx, size_t length, const uint8_t *nonce,
53 size_t authlen, size_t msglen, size_t taglen)
55 ccm_set_nonce(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
56 length, nonce, authlen, msglen, taglen);
60 ccm_aes192_update(struct ccm_aes192_ctx *ctx,
61 size_t length, const uint8_t *data)
63 ccm_update(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
68 ccm_aes192_encrypt(struct ccm_aes192_ctx *ctx,
69 size_t length, uint8_t *dst, const uint8_t *src)
71 ccm_encrypt(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
76 ccm_aes192_decrypt(struct ccm_aes192_ctx *ctx,
77 size_t length, uint8_t *dst, const uint8_t *src)
79 ccm_decrypt(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
84 ccm_aes192_digest(struct ccm_aes192_ctx *ctx,
85 size_t length, uint8_t *digest)
87 ccm_digest(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
92 ccm_aes192_encrypt_message(struct ccm_aes192_ctx *ctx,
93 size_t nlength, const uint8_t *nonce,
94 size_t alength, const uint8_t *adata,
96 size_t clength, uint8_t *dst, const uint8_t *src)
98 ccm_encrypt_message(&ctx->cipher, (nettle_cipher_func *) aes192_encrypt,
99 nlength, nonce, alength, adata,
100 tlength, clength, dst, src);
104 ccm_aes192_decrypt_message(struct ccm_aes192_ctx *ctx,
105 size_t nlength, const uint8_t *nonce,
106 size_t alength, const uint8_t *adata,
108 size_t mlength, uint8_t *dst, const uint8_t *src)
110 return ccm_decrypt_message(&ctx->cipher,
111 (nettle_cipher_func *) aes192_encrypt,
112 nlength, nonce, alength, adata,
113 tlength, mlength, dst, src);