diff --git a/rsa_md5.c b/rsa_md5.c
index a8cf622c7aa54311f5c6a6f5a4464145086cda77..cd72ad2741f414106073bc558e7f0f87d9e0a1c7 100644
--- a/rsa_md5.c
+++ b/rsa_md5.c
@@ -46,9 +46,9 @@ rsa_md5_sign(struct rsa_private_key *key,
              struct md5_ctx *hash,
              mpz_t s)
 {
-  assert(key->pub.size >= 45);
+  assert(key->size >= 45);
 
-  pkcs1_encode_md5(s, key->pub.size - 1, hash);
+  pkcs1_encode_md5(s, key->size - 1, hash);
 
   rsa_compute_root(key, s, s);
 }
diff --git a/rsa_sha1.c b/rsa_sha1.c
index 864e44a0c246b2bd5c626c2a6f9e05827e9570c4..5bf5613fd7f310f869535adc4ceaa582de3afd8d 100644
--- a/rsa_sha1.c
+++ b/rsa_sha1.c
@@ -46,9 +46,9 @@ rsa_sha1_sign(struct rsa_private_key *key,
               struct sha1_ctx *hash,
               mpz_t s)
 {
-  assert(key->pub.size >= 45);
+  assert(key->size >= 45);
 
-  pkcs1_encode_sha1(s, key->pub.size - 1, hash);
+  pkcs1_encode_sha1(s, key->size - 1, hash);
 
   rsa_compute_root(key, s, s);
 }