2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "include/crypto/chacha.h"
11 #include "prov/ciphercommon.h"
14 PROV_CIPHER_CTX base; /* must be first */
17 unsigned int d[CHACHA_KEY_SIZE / 4];
19 unsigned int counter[CHACHA_CTR_SIZE / 4];
20 unsigned char buf[CHACHA_BLK_SIZE];
21 unsigned int partial_len;
24 typedef struct prov_cipher_hw_chacha20_st {
25 PROV_CIPHER_HW base; /* must be first */
26 int (*initiv)(PROV_CIPHER_CTX *ctx);
28 } PROV_CIPHER_HW_CHACHA20;
30 const PROV_CIPHER_HW *PROV_CIPHER_HW_chacha20(size_t keybits);
32 OSSL_OP_cipher_encrypt_init_fn chacha20_einit;
33 OSSL_OP_cipher_decrypt_init_fn chacha20_dinit;
34 void chacha20_initctx(PROV_CHACHA20_CTX *ctx);