1 #ifndef __NETFLASH_CRYPTO_H__
2 #define __NETFLASH_CRYPTO_H__
4 #include <openssl/rsa.h>
5 #include <openssl/pem.h>
6 #include <openssl/md5.h>
7 #include <openssl/aes.h>
9 #define CRYPTO_MAGIC 0xb9b1e546
10 #define LITTLE_CRYPTO_MAGIC 0x2ad6
12 #define AESKEYSIZE (256/8)
14 #define FLAG_ENCRYPTED 0x01
17 * Have to pack this structure. It has been known to change size from
18 * host to target system which causes a few problems!
22 #ifdef CONFIG_USER_NETFLASH_CRYPTO_V2
23 unsigned char hash[SHA256_DIGEST_LENGTH];
25 unsigned char md5[MD5_DIGEST_LENGTH];
27 unsigned char aeskey[AESKEYSIZE];
29 unsigned char padsize;
30 } __attribute__ ((packed));
32 struct little_header {
33 unsigned short hlen; /* Length of encrypted header block */
34 unsigned short magic; /* Magic number for identification purposes */