VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.5/providers/implementations/ciphers/cipher_aes_ccm.h@ 104125

最後變更 在這個檔案從104125是 104078,由 vboxsync 提交於 12 月 前

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

檔案大小: 1.6 KB
 
1/*
2 * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10#include <openssl/aes.h>
11#include "prov/ciphercommon.h"
12#include "prov/ciphercommon_ccm.h"
13#include "crypto/aes_platform.h"
14
15typedef struct prov_aes_ccm_ctx_st {
16 PROV_CCM_CTX base; /* Must be first */
17 union {
18 OSSL_UNION_ALIGN;
19 /*-
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).
24 */
25 struct {
26 unsigned char pad[16];
27 AES_KEY ks;
28 } ks;
29#if defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
30 struct {
31 S390X_KMAC_PARAMS kmac;
32 unsigned long long blocks;
33 union {
34 unsigned long long g[2];
35 unsigned char b[AES_BLOCK_SIZE];
36 } nonce;
37 union {
38 unsigned long long g[2];
39 unsigned char b[AES_BLOCK_SIZE];
40 } buf;
41 unsigned char dummy_pad[168];
42 unsigned int fc; /* fc has same offset as ks.ks.rounds */
43 } s390x;
44#endif /* defined(OPENSSL_CPUID_OBJ) && defined(__s390__) */
45 } ccm;
46} PROV_AES_CCM_CTX;
47
48const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keylen);
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette