
    9i'                         S SK Jr  SSKJr  SSKJrJrJrJrJ	r	J
r
  SSKJr  SSKJr  \" SS5      r " S	 S
\5      rS rS rS rS rS rg)   )_Curve    )Integer)load_pycryptodome_raw_libVoidPointerSmartPointerc_size_tc_uint8_ptrc_ulonglong)long_to_bytes)getrandbitszCrypto.PublicKey._ec_wsa  
typedef void EcContext;
typedef void EcPoint;
int ec_ws_new_context(EcContext **pec_ctx,
                      const uint8_t *modulus,
                      const uint8_t *b,
                      const uint8_t *order,
                      size_t len,
                      uint64_t seed);
void ec_ws_free_context(EcContext *ec_ctx);
int ec_ws_new_point(EcPoint **pecp,
                    const uint8_t *x,
                    const uint8_t *y,
                    size_t len,
                    const EcContext *ec_ctx);
void ec_ws_free_point(EcPoint *ecp);
int ec_ws_get_xy(uint8_t *x,
                 uint8_t *y,
                 size_t len,
                 const EcPoint *ecp);
int ec_ws_double(EcPoint *p);
int ec_ws_add(EcPoint *ecpa, EcPoint *ecpb);
int ec_ws_scalar(EcPoint *ecp,
                 const uint8_t *k,
                 size_t len,
                 uint64_t seed);
int ec_ws_clone(EcPoint **pecp2, const EcPoint *ecp);
int ec_ws_cmp(const EcPoint *ecp1, const EcPoint *ecp2);
int ec_ws_neg(EcPoint *p);
c                      \ rS rSr\R
                  r\R                  r\R                  r
\R                  r\R                  r\R                  r\R"                  r\R&                  r\R*                  r\R.                  r\R2                  rSrg)EcLib-    N)__name__
__module____qualname____firstlineno___ec_libec_ws_new_contextnew_contextec_ws_free_contextfree_contextec_ws_new_point	new_pointec_ws_free_point
free_pointec_ws_get_xyget_xyec_ws_doubledouble	ec_ws_addaddec_ws_scalarscalarec_ws_cloneclone	ec_ws_cmpcmp	ec_ws_negneg__static_attributes__r       Z/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/Crypto/PublicKey/_nist_ecc.pyr   r   -   s{    ++K--L''I))J!!F!!F


C!!FE


C


Cr.   r   c                  L   Sn SnSnSnSn[        U S5      n[        US5      n[        US5      n[        5       n[        R                  UR	                  5       [        U5      [        U5      [        U5      [        [        U5      5      [        [        S5      5      5      n	U	(       a  [        SU	-  5      e[        UR                  5       [        R                  5      n
[        [        U 5      [        U5      [        U5      [        U5      [        U5      S S	S
U
SS[         5      nU$ )Nl   l   9{uDjSg9g(Bl   1(i&^#a;l   +' 1t:_|v!a:@ml   H<^W]dZ{cxW\Iq    @   z#Error %d initializing P-192 context   z1.2.840.10045.3.1.1z
NIST P-192zecdsa-sha2-nistp192r   r   r   r   
address_ofr
   r	   lenr   r   ImportErrorr   getr   r   r   r   )pborderGxGyp192_modulusp192_b
p192_orderec_p192_contextresultcontextp192s               r/   
p192_curverE   ;   s   :A:A>E	;B	;B B'L1b!Fub)J!mO&&'A'A'C'2<'@'26':'2:'>'/L0A'B'2;r?'C)F ?&HII?..0'2L2LMG'!*!*%."+"+''D Kr.   c                  L   Sn SnSnSnSn[        U S5      n[        US5      n[        US5      n[        5       n[        R                  UR	                  5       [        U5      [        U5      [        U5      [        [        U5      5      [        [        S5      5      5      n	U	(       a  [        SU	-  5      e[        UR                  5       [        R                  5      n
[        [        U 5      [        U5      [        U5      [        U5      [        U5      S S	S
U
SS[         5      nU$ )Nl              ?l   FeY8w-X"PVd/%PP!-l   =*8%(?l   !"X!#BXtJ9!'|%VA-l   4~ 
f&Dv@h!fE0m9_qlM/   r2   z#Error %d initializing P-224 context   z1.3.132.0.33z
NIST P-224zecdsa-sha2-nistp224r4   )r9   r:   r;   r<   r=   p224_modulusp224_b
p224_orderec_p224_contextrB   rC   p224s               r/   
p224_curverN   a   s   BABAFE	CB	CB B'L1b!Fub)J!mO&&'A'A'C'2<'@'26':'2:'>'/L0A'B'2;r?'C)F ?&HII?..0'2L2LMG'!*!*%."+"+ 'D Kr.   c                  L   Sn SnSnSnSn[        U S5      n[        US5      n[        US5      n[        5       n[        R                  UR	                  5       [        U5      [        U5      [        U5      [        [        U5      5      [        [        S5      5      5      n	U	(       a  [        SU	-  5      e[        UR                  5       [        R                  5      n
[        [        U 5      [        U5      [        U5      [        U5      [        U5      S S	S
U
SS[         5      nU$ )Nl   ?               @ l   K`Opq^cv
3,e<1U]>{|R*Zl   Q%x+Ohbi+}s   @ l   B11e	%:f=K`wrH7gHK8hkl   Q~o]l+fUg+<)Z?8O?q!O    r2   z#Error %d initializing P-256 context   z1.2.840.10045.3.1.7z
NIST P-256zecdsa-sha2-nistp256r4   )r9   r:   r;   r<   r=   p256_modulusp256_b
p256_orderec_p256_contextrB   rC   p256s               r/   
p256_curverW      s   JAJANE	KB	KB B'L1b!Fub)J!mO&&'A'A'C'2<'@'26':'2:'>'/L0A'B'2;r?'C)F ?&HII?..0'2L2LMG'!*!*%."+"+''D Kr.   c                  L   Sn SnSnSnSn[        U S5      n[        US5      n[        US5      n[        5       n[        R                  UR	                  5       [        U5      [        U5      [        U5      [        [        U5      5      [        [        S5      5      5      n	U	(       a  [        SU	-  5      e[        UR                  5       [        R                  5      n
[        [        U 5      [        U5      [        U5      [        U5      [        U5      S S	S
U
SS[         5      nU$ )Nl          ~l   *'#.TEbc+Z'@=D 1 "(?7N2Z_+|S/1fl   s)e`gwlX_[nlv|l   
dxRjoyU8T(	:ss"nZL8k&"_Ul   _!uR/sX0
@qaNQNB&JxS8KJEY	K%l 0   r2   z#Error %d initializing P-384 contexti  z1.3.132.0.34z
NIST P-384zecdsa-sha2-nistp384r4   )r9   r:   r;   r<   r=   p384_modulusp384_b
p384_orderec_p384_contextrB   rC   p384s               r/   
p384_curver_      s   jAjAnE	kB	kB B'L1b!Fub)J!mO&&'A'A'C'2<'@'26':'2:'>'/L0A'B'2;r?'C)F ?&HII?..0'2L2LMG'!*!*%."+"+ 'D Kr.   c                  L   Sn SnSnSnSn[        U S5      n[        US5      n[        US5      n[        5       n[        R                  UR	                  5       [        U5      [        U5      [        U5      [        [        U5      5      [        [        S5      5      5      n	U	(       a  [        SU	-  5      e[        UR                  5       [        R                  5      n
[        [        U 5      [        U5      [        U5      [        U5      [        U5      S S	S
U
SS[         5      nU$ )Nl#   l#    ?VQ(zO%b95~cte1oR{V;LHw>l-rZE]"Sr&Ga9}*Fl#   	dp"z\}[z3"nZ;PK#
`7roCQl#   f=xK)H-apY$3^Q	n%k{;/K!u{4-{?$Od8V1l3s:l#   Pf?QE$XN!85aZUWL9YLhzf$Du13otc!%pMxjRr`B   r2   z#Error %d initializing P-521 contexti	  z1.3.132.0.35z
NIST P-521zecdsa-sha2-nistp521r4   )r9   r:   r;   r<   r=   p521_modulusp521_b
p521_orderec_p521_contextrB   rC   p521s               r/   
p521_curverg      s    	SA 	SA WE 
TB 
TB B'L1b!Fub)J!mO&&'A'A'C'2<'@'26':'2:'>'/L0A'B'2;r?'C)F ?&HII?..0'2L2LMG'!*!*%."+"+ 'D Kr.   N)_curver   Crypto.Math.Numbersr   Crypto.Util._raw_apir   r   r   r	   r
   r   Crypto.Util.numberr   Crypto.Random.randomr   r   objectr   rE   rN   rW   r_   rg   r   r.   r/   <module>rn      s^     '/ / - , $$= @ @F #L#L#L#L#r.   