blob: fd8bbfa4c72ca61837708eca37ca5fae3d7ea8eb [file] [log] [blame]
// Copyright 2024 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef CORE_FDRM_FX_CRYPT_AES_H_
#define CORE_FDRM_FX_CRYPT_AES_H_
#include <stdint.h>
struct CRYPT_aes_context {
static constexpr int kMaxNb = 8;
static constexpr int kMaxNr = 14;
static constexpr int kSchedSize = (kMaxNr + 1) * kMaxNb;
int Nb;
int Nr;
unsigned int keysched[kSchedSize];
unsigned int invkeysched[kSchedSize];
unsigned int iv[kMaxNb];
};
void CRYPT_AESSetKey(CRYPT_aes_context* ctx,
const uint8_t* key,
uint32_t keylen);
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_AESEncrypt(CRYPT_aes_context* ctx,
uint8_t* dest,
const uint8_t* src,
uint32_t size);
#endif // CORE_FDRM_FX_CRYPT_AES_H_