@@ -393,7 +393,7 @@ impl RSA {
393393 /// }
394394 /// ```
395395 #[ cfg( all( random, rsa_keygen) ) ]
396- pub fn generate ( size : i32 , e : i64 , rng : & mut RNG ) -> Result < Self , i32 > {
396+ pub fn generate ( size : i32 , e : i32 , rng : & mut RNG ) -> Result < Self , i32 > {
397397 Self :: generate_ex ( size, e, rng, None , None )
398398 }
399399
@@ -440,7 +440,7 @@ impl RSA {
440440 /// }
441441 /// ```
442442 #[ cfg( all( random, rsa_keygen) ) ]
443- pub fn generate_ex ( size : i32 , e : i64 , rng : & mut RNG , heap : Option < * mut std:: os:: raw:: c_void > , dev_id : Option < i32 > ) -> Result < Self , i32 > {
443+ pub fn generate_ex ( size : i32 , e : i32 , rng : & mut RNG , heap : Option < * mut std:: os:: raw:: c_void > , dev_id : Option < i32 > ) -> Result < Self , i32 > {
444444 let mut wc_rsakey: MaybeUninit < sys:: RsaKey > = MaybeUninit :: uninit ( ) ;
445445 let heap = match heap {
446446 Some ( heap) => heap,
@@ -455,6 +455,7 @@ impl RSA {
455455 return Err ( rc) ;
456456 }
457457 let mut wc_rsakey = unsafe { wc_rsakey. assume_init ( ) } ;
458+ let e = e as core:: ffi:: c_long ;
458459 let rc = unsafe {
459460 sys:: wc_MakeRsaKey ( & mut wc_rsakey, size, e, & mut rng. wc_rng )
460461 } ;
0 commit comments