Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fx_crypt_aes.h
Go to the documentation of this file.
1// Copyright 2024 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FDRM_FX_CRYPT_AES_H_
8#define CORE_FDRM_FX_CRYPT_AES_H_
9
10#include <stdint.h>
11
12#include <array>
13
14#include "core/fxcrt/span.h"
15
17 static constexpr int kMaxNb = 8;
18 static constexpr int kMaxNr = 14;
19 static constexpr int kSchedSize = (kMaxNr + 1) * kMaxNb;
20
21 int Nb;
22 int Nr;
23 std::array<uint32_t, kSchedSize> keysched;
24 std::array<uint32_t, kSchedSize> invkeysched;
25 std::array<uint32_t, kMaxNb> iv;
26};
27
29 const uint8_t* key,
30 uint32_t keylen);
31void CRYPT_AESSetIV(CRYPT_aes_context* ctx, const uint8_t* iv);
33 uint8_t* dest,
34 const uint8_t* src,
35 uint32_t size);
37 pdfium::span<uint8_t> dest,
38 pdfium::span<const uint8_t> src);
39
40#endif // CORE_FDRM_FX_CRYPT_AES_H_
void CRYPT_MD5Finish(CRYPT_md5_context *context, pdfium::span< uint8_t, 16 > digest)
Definition fx_crypt.cpp:203
#define P(a, b, c, d, k, s, t)
void CRYPT_MD5Generate(pdfium::span< const uint8_t > data, pdfium::span< uint8_t, 16 > digest)
Definition fx_crypt.cpp:219
#define S(x, n)
void CRYPT_ArcFourCryptBlock(pdfium::span< uint8_t > data, pdfium::span< const uint8_t > key)
Definition fx_crypt.cpp:157
void CRYPT_ArcFourSetup(CRYPT_rc4_context *context, pdfium::span< const uint8_t > key)
Definition fx_crypt.cpp:131
void CRYPT_MD5Update(CRYPT_md5_context *context, pdfium::span< const uint8_t > data)
Definition fx_crypt.cpp:175
void CRYPT_ArcFourCrypt(CRYPT_rc4_context *context, pdfium::span< uint8_t > data)
Definition fx_crypt.cpp:146
CRYPT_md5_context CRYPT_MD5Start()
Definition fx_crypt.cpp:164
void CRYPT_AESEncrypt(CRYPT_aes_context *ctx, pdfium::span< uint8_t > dest, pdfium::span< const uint8_t > src)
void CRYPT_AESSetIV(CRYPT_aes_context *ctx, const uint8_t *iv)
void CRYPT_AESDecrypt(CRYPT_aes_context *ctx, uint8_t *dest, const uint8_t *src, uint32_t size)
void CRYPT_AESSetKey(CRYPT_aes_context *ctx, const uint8_t *key, uint32_t keylen)
std::array< uint32_t, kMaxNb > iv
std::array< uint32_t, kSchedSize > invkeysched
static constexpr int kMaxNr
static constexpr int kSchedSize
static constexpr int kMaxNb
std::array< uint32_t, kSchedSize > keysched
uint8_t buffer[64]
Definition fx_crypt.h:28
std::array< uint32_t, 4 > state
Definition fx_crypt.h:27
std::array< uint32_t, 2 > total
Definition fx_crypt.h:26
std::array< int32_t, kPermutationLength > m
Definition fx_crypt.h:22
static constexpr int32_t kPermutationLength
Definition fx_crypt.h:18