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 <openssl/aes.h>
11 #include "prov/ciphercommon.h"
12 #include "prov/ciphercommon_ccm.h"
13 #include "crypto/aes_platform.h"
15 typedef struct prov_aes_ccm_ctx_st {
16 PROV_CCM_CTX base; /* Must be first */
20 * Padding is chosen so that s390x.kmac.k overlaps with ks.ks and
21 * fc with ks.ks.rounds. Remember that on s390x, an AES_KEY's
22 * rounds field is used to store the function code and that the key
23 * schedule is not stored (if aes hardware support is detected).
26 unsigned char pad[16];
29 #if defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
31 S390X_KMAC_PARAMS kmac;
32 unsigned long long blocks;
34 unsigned long long g[2];
35 unsigned char b[AES_BLOCK_SIZE];
38 unsigned long long g[2];
39 unsigned char b[AES_BLOCK_SIZE];
41 unsigned char dummy_pad[168];
42 unsigned int fc; /* fc has same offset as ks.ks.rounds */
44 #endif /* defined(OPENSSL_CPUID_OBJ) && defined(__s390__) */
48 const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keylen);