Skip to content
Snippets Groups Projects
Commit 3adff46e authored by Niels Möller's avatar Niels Möller
Browse files

Expanded the

comment describing the file format, and moved to rsa-session.h.

Rev: src/nettle/examples/rsa-encrypt.c:1.3
Rev: src/nettle/examples/rsa-session.h:1.2
parent 38c7d4dc
No related branches found
No related tags found
No related merge requests found
...@@ -22,32 +22,6 @@ ...@@ -22,32 +22,6 @@
* MA 02111-1307, USA. * MA 02111-1307, USA.
*/ */
/* Encryption program using the following file format:
uint32_t version = 1;
uint32_t xsize;
uint8_t x[xsize];
uint8_t encrypted[n];
uint8_t hmac[SHA1_DIGEST_SIZE];
"x" is the data
uint32_t version = 1;
uint8_t aes_key[AES_KEY_SIZE];
uint8_t iv[AES_BLOCK_SIZE];
uint8_t hmac_key[SHA1_DIGEST_SIZE];
of size (4 + AES_KEY_SIZE + AES_BLOCK_SIZE + SHA1_DIGEST_SIZE) = 72
bytes, encrypted using rsa-pkcs1.
"encrypted" is the cleartext processed with aes-cbc. The final block is padded as
| data | random octets | padding length |
where the last octet is the padding length, a number between 1 and
AES_BLOCK_SIZE (inclusive).
*/
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
......
...@@ -27,6 +27,14 @@ ...@@ -27,6 +27,14 @@
of size (4 + AES_KEY_SIZE + AES_BLOCK_SIZE + SHA1_DIGEST_SIZE) = 72 of size (4 + AES_KEY_SIZE + AES_BLOCK_SIZE + SHA1_DIGEST_SIZE) = 72
bytes, encrypted using rsa-pkcs1. bytes, encrypted using rsa-pkcs1.
The cleartext input is encrypted using aes-cbc. The final block is
padded as
| data | random octets | padding length |
where the last octet is the padding length, a number between 1 and
AES_BLOCK_SIZE (inclusive).
*/ */
struct rsa_session struct rsa_session
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment