
    E#i                        S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
Jr  S	S
KJr   " S S\5      r " S S\5      rg)z7Module with interfaces for public/private keys classes.    )annotations)ABCabstractmethod)Any   )IPoint   )EllipticCurveTypes   )	DataBytesc                  F   \ rS rSrSr\\    SS j5       5       r\\    SS j5       5       r\	\SS j5       5       r
\    SS j5       r\    SS j5       r\	\SS j5       5       r\	\SS	 j5       5       r\SS
 j5       r\SS j5       r\SS j5       r\SS j5       rSrg)
IPublicKey"   za
Interface for a generic elliptic curve public key.
Verify method is missing because not needed.
c                    g)z
Construct class from key bytes.

Args:
    key_bytes (bytes): Key bytes

Returns:
    IPublicKey: IPublicKey object

Raises:
    ValueError: If key bytes are not valid
N cls	key_bytess     g/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/static_dependencies/bip/ecc/common/ikeys.py	FromBytesIPublicKey.FromBytes(           c                    g)z
Construct class from key point.

Args:
    key_point (IPoint object): Key point

Returns:
    IPublicKey: IPublicKey object

Raises:
    ValueError: If key point is not valid
Nr   r   	key_points     r   	FromPointIPublicKey.FromPoint9   r   r   c                     gzS
Get the elliptic curve type.

Returns:
   EllipticCurveTypes: Elliptic curve type
Nr   r   r   r   	CurveTypeIPublicKey.CurveTypeJ   r   r   c                H     U R                  U5        g! [         a     gf = f)z
Return if the specified bytes represents a valid public key.

Args:
    key_bytes (bytes): Key bytes

Returns:
    bool: True if valid, false otherwise
TFr   
ValueErrorr   s     r   IsValidBytesIPublicKey.IsValidBytesT   (    	MM)$ 		    
!!c                H     U R                  U5        g! [         a     gf = f)z
Return if the specified point represents a valid public key.

Args:
    key_point (IPoint object): Key point

Returns:
    bool: True if valid, false otherwise
TF)r   r%   r   s     r   IsValidPointIPublicKey.IsValidPointf   r(   r)   c                     g)zH
Get the compressed key length.

Returns:
   int: Compressed key length
Nr   r   r   r   CompressedLengthIPublicKey.CompressedLengthx   r   r   c                     g)zL
Get the uncompressed key length.

Returns:
   int: Uncompressed key length
Nr   r   r   r   UncompressedLengthIPublicKey.UncompressedLength   r   r   c                    gz@
Get the underlying object.

Returns:
   Any: Underlying object
Nr   selfs    r   UnderlyingObjectIPublicKey.UnderlyingObject   r   r   c                    g)zT
Return raw compressed public key.

Returns:
    DataBytes object: DataBytes object
Nr   r5   s    r   RawCompressedIPublicKey.RawCompressed   r   r   c                    g)zV
Return raw uncompressed public key.

Returns:
    DataBytes object: DataBytes object
Nr   r5   s    r   RawUncompressedIPublicKey.RawUncompressed   r   r   c                    g)zI
Return the public key point.

Returns:
    IPoint object: IPoint object
Nr   r5   s    r   PointIPublicKey.Point   r   r   r   N)r   bytesreturnr   )r   r   rC   r   rC   r
   r   rB   rC   bool)r   r   rC   rF   rC   intrC   r   rC   r   )rC   r   )__name__
__module____qualname____firstlineno____doc__classmethodr   r   r   staticmethodr!   r&   r+   r.   r1   r7   r:   r=   r@   __static_attributes__r   r   r   r   r   "   sK   
 "'1   #(2       %*. "  &+/ "              r   r   c                      \ rS rSrSr\\    SS j5       5       r\\SS j5       5       r	\    SS j5       r
\\SS j5       5       r\SS j5       r\SS j5       r\SS	 j5       rS
rg)IPrivateKey   z`
Interface for a generic elliptic curve private key.
Sign method is missing because not needed.
c                    g)z
Construct class from key bytes.

Args:
    key_bytes (bytes): Key bytes

Returns:
    IPrivateKey: IPrivateKey object

Raises:
    ValueError: If key bytes are not valid
Nr   r   s     r   r   IPrivateKey.FromBytes   r   r   c                     gr    r   r   r   r   r!   IPrivateKey.CurveType   r   r   c                H     U R                  U5        g! [         a     gf = f)z
Return if the specified bytes represent a valid private key.

Args:
    key_bytes (bytes): key bytes

Returns:
    bool: True if valid, false otherwise
TFr$   r   s     r   r&   IPrivateKey.IsValidBytes   r(   r)   c                     g)z2
Get the key length.

Returns:
   int: Key length
Nr   r   r   r   LengthIPrivateKey.Length   r   r   c                    gr4   r   r5   s    r   r7   IPrivateKey.UnderlyingObject   r   r   c                    g)zJ
Return raw private key.

Returns:
    DataBytes object: DataBytes object
Nr   r5   s    r   RawIPrivateKey.Raw   r   r   c                    g)zi
Get the public key correspondent to the private one.

Returns:
    IPublicKey object: IPublicKey object
Nr   r5   s    r   	PublicKeyIPrivateKey.PublicKey   r   r   r   N)r   rB   rC   rT   rD   rE   rG   rI   rJ   )rC   r   )rK   rL   rM   rN   rO   rP   r   r   rQ   r!   r&   r]   r7   rb   re   rR   r   r   r   rT   rT      s    
 "'2       %*. "         r   rT   N)rO   
__future__r   abcr   r   typingr   ipointr   curve.elliptic_curve_typesr
   
utils.miscr   r   rT   r   r   r   <module>rm      s;   * > # #   ; #L L^V# Vr   