@@ -149,7 +149,7 @@ impl DHPrivateKey {
149149 . map_err ( |_| pyo3:: exceptions:: PyValueError :: new_err ( "Error computing shared key." ) ) ?;
150150
151151 let len = deriver. len ( ) ?;
152- Ok ( pyo3:: types:: PyBytes :: new_bound_with ( py, len, |b| {
152+ Ok ( pyo3:: types:: PyBytes :: new_with ( py, len, |b| {
153153 let n = deriver. derive ( b) . unwrap ( ) ;
154154
155155 let pad = b. len ( ) - n;
@@ -363,34 +363,34 @@ impl DHParameters {
363363#[ pyo3:: pyclass( frozen, module = "cryptography.hazmat.primitives.asymmetric.dh" ) ]
364364struct DHPrivateNumbers {
365365 #[ pyo3( get) ]
366- x : pyo3:: Py < pyo3:: types:: PyLong > ,
366+ x : pyo3:: Py < pyo3:: types:: PyInt > ,
367367 #[ pyo3( get) ]
368368 public_numbers : pyo3:: Py < DHPublicNumbers > ,
369369}
370370
371371#[ pyo3:: pyclass( frozen, module = "cryptography.hazmat.primitives.asymmetric.dh" ) ]
372372struct DHPublicNumbers {
373373 #[ pyo3( get) ]
374- y : pyo3:: Py < pyo3:: types:: PyLong > ,
374+ y : pyo3:: Py < pyo3:: types:: PyInt > ,
375375 #[ pyo3( get) ]
376376 parameter_numbers : pyo3:: Py < DHParameterNumbers > ,
377377}
378378
379379#[ pyo3:: pyclass( frozen, module = "cryptography.hazmat.primitives.asymmetric.dh" ) ]
380380struct DHParameterNumbers {
381381 #[ pyo3( get) ]
382- p : pyo3:: Py < pyo3:: types:: PyLong > ,
382+ p : pyo3:: Py < pyo3:: types:: PyInt > ,
383383 #[ pyo3( get) ]
384- g : pyo3:: Py < pyo3:: types:: PyLong > ,
384+ g : pyo3:: Py < pyo3:: types:: PyInt > ,
385385 #[ pyo3( get) ]
386- q : Option < pyo3:: Py < pyo3:: types:: PyLong > > ,
386+ q : Option < pyo3:: Py < pyo3:: types:: PyInt > > ,
387387}
388388
389389#[ pyo3:: pymethods]
390390impl DHPrivateNumbers {
391391 #[ new]
392392 fn new (
393- x : pyo3:: Py < pyo3:: types:: PyLong > ,
393+ x : pyo3:: Py < pyo3:: types:: PyInt > ,
394394 public_numbers : pyo3:: Py < DHPublicNumbers > ,
395395 ) -> DHPrivateNumbers {
396396 DHPrivateNumbers { x, public_numbers }
@@ -428,7 +428,7 @@ impl DHPrivateNumbers {
428428 py : pyo3:: Python < ' _ > ,
429429 other : pyo3:: PyRef < ' _ , Self > ,
430430 ) -> CryptographyResult < bool > {
431- Ok ( self . x . bind ( py) . eq ( other. x . bind ( py) ) ?
431+ Ok ( ( * * self . x . bind ( py) ) . eq ( other. x . bind ( py) ) ?
432432 && self
433433 . public_numbers
434434 . bind ( py)
@@ -440,7 +440,7 @@ impl DHPrivateNumbers {
440440impl DHPublicNumbers {
441441 #[ new]
442442 fn new (
443- y : pyo3:: Py < pyo3:: types:: PyLong > ,
443+ y : pyo3:: Py < pyo3:: types:: PyInt > ,
444444 parameter_numbers : pyo3:: Py < DHParameterNumbers > ,
445445 ) -> DHPublicNumbers {
446446 DHPublicNumbers {
@@ -472,7 +472,7 @@ impl DHPublicNumbers {
472472 py : pyo3:: Python < ' _ > ,
473473 other : pyo3:: PyRef < ' _ , Self > ,
474474 ) -> CryptographyResult < bool > {
475- Ok ( self . y . bind ( py) . eq ( other. y . bind ( py) ) ?
475+ Ok ( ( * * self . y . bind ( py) ) . eq ( other. y . bind ( py) ) ?
476476 && self
477477 . parameter_numbers
478478 . bind ( py)
@@ -486,9 +486,9 @@ impl DHParameterNumbers {
486486 #[ pyo3( signature = ( p, g, q=None ) ) ]
487487 fn new (
488488 py : pyo3:: Python < ' _ > ,
489- p : pyo3:: Py < pyo3:: types:: PyLong > ,
490- g : pyo3:: Py < pyo3:: types:: PyLong > ,
491- q : Option < pyo3:: Py < pyo3:: types:: PyLong > > ,
489+ p : pyo3:: Py < pyo3:: types:: PyInt > ,
490+ g : pyo3:: Py < pyo3:: types:: PyInt > ,
491+ q : Option < pyo3:: Py < pyo3:: types:: PyInt > > ,
492492 ) -> CryptographyResult < DHParameterNumbers > {
493493 if g. bind ( py) . lt ( 2 ) ? {
494494 return Err ( CryptographyError :: from (
@@ -528,12 +528,12 @@ impl DHParameterNumbers {
528528 other : pyo3:: PyRef < ' _ , Self > ,
529529 ) -> CryptographyResult < bool > {
530530 let q_equal = match ( self . q . as_ref ( ) , other. q . as_ref ( ) ) {
531- ( Some ( self_q) , Some ( other_q) ) => self_q. bind ( py) . eq ( other_q. bind ( py) ) ?,
531+ ( Some ( self_q) , Some ( other_q) ) => ( * * self_q. bind ( py) ) . eq ( other_q. bind ( py) ) ?,
532532 ( None , None ) => true ,
533533 _ => false ,
534534 } ;
535- Ok ( self . p . bind ( py) . eq ( other. p . bind ( py) ) ?
536- && self . g . bind ( py) . eq ( other. g . bind ( py) ) ?
535+ Ok ( ( * * self . p . bind ( py) ) . eq ( other. p . bind ( py) ) ?
536+ && ( * * self . g . bind ( py) ) . eq ( other. g . bind ( py) ) ?
537537 && q_equal)
538538 }
539539}
0 commit comments