2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-19 18:32:21 +00:00
qpdf/libqpdf/qpdf/rijndael.h
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00

33 lines
811 B
C

#ifndef RIJNDAEL_H
#define RIJNDAEL_H
#include <qpdf/qpdf-config.h>
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stddef.h>
unsigned int
rijndaelSetupEncrypt(uint32_t* rk, const unsigned char* key, size_t keybits);
unsigned int
rijndaelSetupDecrypt(uint32_t* rk, const unsigned char* key, size_t keybits);
void rijndaelEncrypt(
const uint32_t* rk,
unsigned int nrounds,
const unsigned char plaintext[16],
unsigned char ciphertext[16]);
void rijndaelDecrypt(
const uint32_t* rk,
unsigned int nrounds,
const unsigned char ciphertext[16],
unsigned char plaintext[16]);
#define KEYLENGTH(keybits) ((keybits) / 8)
#define RKLENGTH(keybits) ((keybits) / 8 + 28)
#define NROUNDS(keybits) ((keybits) / 32 + 6)
#endif