ccxt-ir 4.3.46.0.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +358 -0
- ccxt/abantether.py +316 -0
- ccxt/abstract/__init__.py +0 -0
- ccxt/abstract/abantether.py +5 -0
- ccxt/abstract/ace.py +15 -0
- ccxt/abstract/afratether.py +6 -0
- ccxt/abstract/alpaca.py +70 -0
- ccxt/abstract/arzinja.py +5 -0
- ccxt/abstract/arzplus.py +7 -0
- ccxt/abstract/ascendex.py +77 -0
- ccxt/abstract/bequant.py +115 -0
- ccxt/abstract/bigone.py +45 -0
- ccxt/abstract/binance.py +712 -0
- ccxt/abstract/binancecoinm.py +712 -0
- ccxt/abstract/binanceus.py +764 -0
- ccxt/abstract/binanceusdm.py +712 -0
- ccxt/abstract/bingx.py +113 -0
- ccxt/abstract/bit2c.py +27 -0
- ccxt/abstract/bitbank.py +27 -0
- ccxt/abstract/bitbay.py +53 -0
- ccxt/abstract/bitbns.py +40 -0
- ccxt/abstract/bitcoincom.py +115 -0
- ccxt/abstract/bitfinex.py +69 -0
- ccxt/abstract/bitfinex2.py +139 -0
- ccxt/abstract/bitflyer.py +38 -0
- ccxt/abstract/bitget.py +508 -0
- ccxt/abstract/bithumb.py +32 -0
- ccxt/abstract/bitimen.py +7 -0
- ccxt/abstract/bitir.py +7 -0
- ccxt/abstract/bitmart.py +99 -0
- ccxt/abstract/bitmex.py +97 -0
- ccxt/abstract/bitopro.py +29 -0
- ccxt/abstract/bitpanda.py +35 -0
- ccxt/abstract/bitpin.py +7 -0
- ccxt/abstract/bitrue.py +72 -0
- ccxt/abstract/bitso.py +43 -0
- ccxt/abstract/bitstamp.py +258 -0
- ccxt/abstract/bitteam.py +29 -0
- ccxt/abstract/bitvavo.py +27 -0
- ccxt/abstract/bl3p.py +19 -0
- ccxt/abstract/blockchaincom.py +28 -0
- ccxt/abstract/blofin.py +37 -0
- ccxt/abstract/btcalpha.py +18 -0
- ccxt/abstract/btcbox.py +13 -0
- ccxt/abstract/btcmarkets.py +39 -0
- ccxt/abstract/btcturk.py +20 -0
- ccxt/abstract/bybit.py +298 -0
- ccxt/abstract/cex.py +33 -0
- ccxt/abstract/coinbase.py +94 -0
- ccxt/abstract/coinbaseadvanced.py +94 -0
- ccxt/abstract/coinbaseexchange.py +67 -0
- ccxt/abstract/coinbaseinternational.py +39 -0
- ccxt/abstract/coincatch.py +94 -0
- ccxt/abstract/coincheck.py +33 -0
- ccxt/abstract/coinex.py +237 -0
- ccxt/abstract/coinlist.py +54 -0
- ccxt/abstract/coinmate.py +62 -0
- ccxt/abstract/coinmetro.py +34 -0
- ccxt/abstract/coinone.py +67 -0
- ccxt/abstract/coinsph.py +54 -0
- ccxt/abstract/coinspot.py +28 -0
- ccxt/abstract/cryptocom.py +107 -0
- ccxt/abstract/currencycom.py +68 -0
- ccxt/abstract/delta.py +50 -0
- ccxt/abstract/deribit.py +125 -0
- ccxt/abstract/digifinex.py +91 -0
- ccxt/abstract/eterex.py +5 -0
- ccxt/abstract/excoino.py +7 -0
- ccxt/abstract/exir.py +8 -0
- ccxt/abstract/exmo.py +55 -0
- ccxt/abstract/exnovin.py +6 -0
- ccxt/abstract/farhadexchange.py +5 -0
- ccxt/abstract/fmfwio.py +115 -0
- ccxt/abstract/gate.py +265 -0
- ccxt/abstract/gateio.py +265 -0
- ccxt/abstract/gemini.py +58 -0
- ccxt/abstract/hashkey.py +67 -0
- ccxt/abstract/hitbtc.py +115 -0
- ccxt/abstract/hitbtc3.py +115 -0
- ccxt/abstract/hitobit.py +8 -0
- ccxt/abstract/hollaex.py +33 -0
- ccxt/abstract/htx.py +548 -0
- ccxt/abstract/huobi.py +548 -0
- ccxt/abstract/huobijp.py +114 -0
- ccxt/abstract/hyperliquid.py +6 -0
- ccxt/abstract/idex.py +26 -0
- ccxt/abstract/independentreserve.py +37 -0
- ccxt/abstract/indodax.py +26 -0
- ccxt/abstract/jibitex.py +7 -0
- ccxt/abstract/kraken.py +57 -0
- ccxt/abstract/krakenfutures.py +38 -0
- ccxt/abstract/kucoin.py +214 -0
- ccxt/abstract/kucoinfutures.py +233 -0
- ccxt/abstract/kuna.py +182 -0
- ccxt/abstract/latoken.py +56 -0
- ccxt/abstract/lbank.py +61 -0
- ccxt/abstract/luno.py +37 -0
- ccxt/abstract/lykke.py +29 -0
- ccxt/abstract/mercado.py +25 -0
- ccxt/abstract/mexc.py +178 -0
- ccxt/abstract/ndax.py +97 -0
- ccxt/abstract/nobitex.py +7 -0
- ccxt/abstract/novadax.py +29 -0
- ccxt/abstract/oceanex.py +22 -0
- ccxt/abstract/okcoin.py +74 -0
- ccxt/abstract/okexchange.py +8 -0
- ccxt/abstract/okx.py +324 -0
- ccxt/abstract/ompfinex.py +7 -0
- ccxt/abstract/onetrading.py +35 -0
- ccxt/abstract/oxfun.py +34 -0
- ccxt/abstract/p2b.py +22 -0
- ccxt/abstract/paradex.py +40 -0
- ccxt/abstract/paymium.py +28 -0
- ccxt/abstract/phemex.py +115 -0
- ccxt/abstract/poloniex.py +69 -0
- ccxt/abstract/poloniexfutures.py +48 -0
- ccxt/abstract/probit.py +23 -0
- ccxt/abstract/ramzinex.py +7 -0
- ccxt/abstract/sarmayex.py +5 -0
- ccxt/abstract/sarrafex.py +7 -0
- ccxt/abstract/tabdeal.py +7 -0
- ccxt/abstract/tetherland.py +5 -0
- ccxt/abstract/timex.py +62 -0
- ccxt/abstract/tokocrypto.py +37 -0
- ccxt/abstract/tradeogre.py +16 -0
- ccxt/abstract/twox.py +5 -0
- ccxt/abstract/ubitex.py +7 -0
- ccxt/abstract/upbit.py +38 -0
- ccxt/abstract/vertex.py +19 -0
- ccxt/abstract/wallex.py +8 -0
- ccxt/abstract/wavesexchange.py +154 -0
- ccxt/abstract/wazirx.py +30 -0
- ccxt/abstract/whitebit.py +98 -0
- ccxt/abstract/woo.py +83 -0
- ccxt/abstract/woofipro.py +119 -0
- ccxt/abstract/xt.py +152 -0
- ccxt/abstract/yobit.py +16 -0
- ccxt/abstract/zaif.py +38 -0
- ccxt/abstract/zonda.py +53 -0
- ccxt/ace.py +1012 -0
- ccxt/afratether.py +293 -0
- ccxt/alpaca.py +1083 -0
- ccxt/arzinja.py +285 -0
- ccxt/arzplus.py +412 -0
- ccxt/ascendex.py +3330 -0
- ccxt/async_support/__init__.py +337 -0
- ccxt/async_support/abantether.py +316 -0
- ccxt/async_support/ace.py +1012 -0
- ccxt/async_support/afratether.py +293 -0
- ccxt/async_support/alpaca.py +1083 -0
- ccxt/async_support/arzinja.py +285 -0
- ccxt/async_support/arzplus.py +412 -0
- ccxt/async_support/ascendex.py +3330 -0
- ccxt/async_support/base/__init__.py +1 -0
- ccxt/async_support/base/exchange.py +1966 -0
- ccxt/async_support/base/throttler.py +50 -0
- ccxt/async_support/base/ws/__init__.py +38 -0
- ccxt/async_support/base/ws/aiohttp_client.py +125 -0
- ccxt/async_support/base/ws/cache.py +212 -0
- ccxt/async_support/base/ws/client.py +193 -0
- ccxt/async_support/base/ws/fast_client.py +96 -0
- ccxt/async_support/base/ws/functions.py +59 -0
- ccxt/async_support/base/ws/future.py +58 -0
- ccxt/async_support/base/ws/order_book.py +78 -0
- ccxt/async_support/base/ws/order_book_side.py +174 -0
- ccxt/async_support/bequant.py +33 -0
- ccxt/async_support/bigone.py +2113 -0
- ccxt/async_support/binance.py +12234 -0
- ccxt/async_support/binancecoinm.py +45 -0
- ccxt/async_support/binanceus.py +211 -0
- ccxt/async_support/binanceusdm.py +58 -0
- ccxt/async_support/bingx.py +4325 -0
- ccxt/async_support/bit2c.py +866 -0
- ccxt/async_support/bitbank.py +1001 -0
- ccxt/async_support/bitbay.py +17 -0
- ccxt/async_support/bitbns.py +1154 -0
- ccxt/async_support/bitcoincom.py +17 -0
- ccxt/async_support/bitfinex.py +1617 -0
- ccxt/async_support/bitfinex2.py +3552 -0
- ccxt/async_support/bitflyer.py +995 -0
- ccxt/async_support/bitget.py +8273 -0
- ccxt/async_support/bithumb.py +1061 -0
- ccxt/async_support/bitimen.py +401 -0
- ccxt/async_support/bitir.py +490 -0
- ccxt/async_support/bitmart.py +4415 -0
- ccxt/async_support/bitmex.py +2756 -0
- ccxt/async_support/bitopro.py +1630 -0
- ccxt/async_support/bitpanda.py +16 -0
- ccxt/async_support/bitpin.py +454 -0
- ccxt/async_support/bitrue.py +3027 -0
- ccxt/async_support/bitso.py +1670 -0
- ccxt/async_support/bitstamp.py +2203 -0
- ccxt/async_support/bitteam.py +2239 -0
- ccxt/async_support/bitvavo.py +1968 -0
- ccxt/async_support/bl3p.py +485 -0
- ccxt/async_support/blockchaincom.py +1104 -0
- ccxt/async_support/blofin.py +2066 -0
- ccxt/async_support/btcalpha.py +891 -0
- ccxt/async_support/btcbox.py +544 -0
- ccxt/async_support/btcmarkets.py +1221 -0
- ccxt/async_support/btcturk.py +911 -0
- ccxt/async_support/bybit.py +8159 -0
- ccxt/async_support/cex.py +1605 -0
- ccxt/async_support/coinbase.py +4475 -0
- ccxt/async_support/coinbaseadvanced.py +17 -0
- ccxt/async_support/coinbaseexchange.py +1734 -0
- ccxt/async_support/coinbaseinternational.py +1899 -0
- ccxt/async_support/coincatch.py +5069 -0
- ccxt/async_support/coincheck.py +815 -0
- ccxt/async_support/coinex.py +5526 -0
- ccxt/async_support/coinlist.py +2243 -0
- ccxt/async_support/coinmate.py +1067 -0
- ccxt/async_support/coinmetro.py +1797 -0
- ccxt/async_support/coinone.py +1127 -0
- ccxt/async_support/coinsph.py +1850 -0
- ccxt/async_support/coinspot.py +534 -0
- ccxt/async_support/cryptocom.py +2822 -0
- ccxt/async_support/currencycom.py +1950 -0
- ccxt/async_support/delta.py +3376 -0
- ccxt/async_support/deribit.py +3437 -0
- ccxt/async_support/digifinex.py +3960 -0
- ccxt/async_support/eterex.py +286 -0
- ccxt/async_support/excoino.py +399 -0
- ccxt/async_support/exir.py +375 -0
- ccxt/async_support/exmo.py +2462 -0
- ccxt/async_support/exnovin.py +360 -0
- ccxt/async_support/farhadexchange.py +266 -0
- ccxt/async_support/fmfwio.py +34 -0
- ccxt/async_support/gate.py +6976 -0
- ccxt/async_support/gateio.py +16 -0
- ccxt/async_support/gemini.py +1825 -0
- ccxt/async_support/hashkey.py +4150 -0
- ccxt/async_support/hitbtc.py +3423 -0
- ccxt/async_support/hitbtc3.py +16 -0
- ccxt/async_support/hitobit.py +391 -0
- ccxt/async_support/hollaex.py +1813 -0
- ccxt/async_support/htx.py +8506 -0
- ccxt/async_support/huobi.py +16 -0
- ccxt/async_support/huobijp.py +1801 -0
- ccxt/async_support/hyperliquid.py +2431 -0
- ccxt/async_support/idex.py +1766 -0
- ccxt/async_support/independentreserve.py +784 -0
- ccxt/async_support/indodax.py +1247 -0
- ccxt/async_support/jibitex.py +395 -0
- ccxt/async_support/kraken.py +2894 -0
- ccxt/async_support/krakenfutures.py +2601 -0
- ccxt/async_support/kucoin.py +4602 -0
- ccxt/async_support/kucoinfutures.py +2698 -0
- ccxt/async_support/kuna.py +1841 -0
- ccxt/async_support/latoken.py +1664 -0
- ccxt/async_support/lbank.py +2683 -0
- ccxt/async_support/luno.py +1067 -0
- ccxt/async_support/lykke.py +1270 -0
- ccxt/async_support/mercado.py +842 -0
- ccxt/async_support/mexc.py +5369 -0
- ccxt/async_support/ndax.py +2354 -0
- ccxt/async_support/nobitex.py +419 -0
- ccxt/async_support/novadax.py +1484 -0
- ccxt/async_support/oceanex.py +903 -0
- ccxt/async_support/okcoin.py +2936 -0
- ccxt/async_support/okexchange.py +349 -0
- ccxt/async_support/okx.py +7827 -0
- ccxt/async_support/ompfinex.py +472 -0
- ccxt/async_support/onetrading.py +1911 -0
- ccxt/async_support/oxfun.py +2773 -0
- ccxt/async_support/p2b.py +1194 -0
- ccxt/async_support/paradex.py +2015 -0
- ccxt/async_support/paymium.py +564 -0
- ccxt/async_support/phemex.py +4473 -0
- ccxt/async_support/poloniex.py +2232 -0
- ccxt/async_support/poloniexfutures.py +1717 -0
- ccxt/async_support/probit.py +1734 -0
- ccxt/async_support/ramzinex.py +476 -0
- ccxt/async_support/sarmayex.py +357 -0
- ccxt/async_support/sarrafex.py +478 -0
- ccxt/async_support/tabdeal.py +364 -0
- ccxt/async_support/tetherland.py +349 -0
- ccxt/async_support/timex.py +1593 -0
- ccxt/async_support/tokocrypto.py +2405 -0
- ccxt/async_support/tradeogre.py +608 -0
- ccxt/async_support/twox.py +326 -0
- ccxt/async_support/ubitex.py +409 -0
- ccxt/async_support/upbit.py +1833 -0
- ccxt/async_support/vertex.py +2922 -0
- ccxt/async_support/wallex.py +445 -0
- ccxt/async_support/wavesexchange.py +2473 -0
- ccxt/async_support/wazirx.py +1224 -0
- ccxt/async_support/whitebit.py +2469 -0
- ccxt/async_support/woo.py +3114 -0
- ccxt/async_support/woofipro.py +2533 -0
- ccxt/async_support/xt.py +4454 -0
- ccxt/async_support/yobit.py +1283 -0
- ccxt/async_support/zaif.py +725 -0
- ccxt/async_support/zonda.py +1828 -0
- ccxt/base/__init__.py +27 -0
- ccxt/base/decimal_to_precision.py +174 -0
- ccxt/base/errors.py +242 -0
- ccxt/base/exchange.py +5941 -0
- ccxt/base/precise.py +287 -0
- ccxt/base/types.py +502 -0
- ccxt/bequant.py +33 -0
- ccxt/bigone.py +2112 -0
- ccxt/binance.py +12233 -0
- ccxt/binancecoinm.py +45 -0
- ccxt/binanceus.py +211 -0
- ccxt/binanceusdm.py +58 -0
- ccxt/bingx.py +4324 -0
- ccxt/bit2c.py +866 -0
- ccxt/bitbank.py +1001 -0
- ccxt/bitbay.py +17 -0
- ccxt/bitbns.py +1154 -0
- ccxt/bitcoincom.py +17 -0
- ccxt/bitfinex.py +1617 -0
- ccxt/bitfinex2.py +3552 -0
- ccxt/bitflyer.py +995 -0
- ccxt/bitget.py +8272 -0
- ccxt/bithumb.py +1061 -0
- ccxt/bitimen.py +401 -0
- ccxt/bitir.py +490 -0
- ccxt/bitmart.py +4415 -0
- ccxt/bitmex.py +2756 -0
- ccxt/bitopro.py +1630 -0
- ccxt/bitpanda.py +16 -0
- ccxt/bitpin.py +454 -0
- ccxt/bitrue.py +3026 -0
- ccxt/bitso.py +1670 -0
- ccxt/bitstamp.py +2203 -0
- ccxt/bitteam.py +2239 -0
- ccxt/bitvavo.py +1968 -0
- ccxt/bl3p.py +485 -0
- ccxt/blockchaincom.py +1104 -0
- ccxt/blofin.py +2066 -0
- ccxt/btcalpha.py +891 -0
- ccxt/btcbox.py +544 -0
- ccxt/btcmarkets.py +1221 -0
- ccxt/btcturk.py +911 -0
- ccxt/bybit.py +8158 -0
- ccxt/cex.py +1605 -0
- ccxt/coinbase.py +4474 -0
- ccxt/coinbaseadvanced.py +17 -0
- ccxt/coinbaseexchange.py +1734 -0
- ccxt/coinbaseinternational.py +1899 -0
- ccxt/coincatch.py +5069 -0
- ccxt/coincheck.py +815 -0
- ccxt/coinex.py +5525 -0
- ccxt/coinlist.py +2243 -0
- ccxt/coinmate.py +1067 -0
- ccxt/coinmetro.py +1797 -0
- ccxt/coinone.py +1127 -0
- ccxt/coinsph.py +1850 -0
- ccxt/coinspot.py +534 -0
- ccxt/cryptocom.py +2822 -0
- ccxt/currencycom.py +1950 -0
- ccxt/delta.py +3376 -0
- ccxt/deribit.py +3437 -0
- ccxt/digifinex.py +3959 -0
- ccxt/eterex.py +286 -0
- ccxt/excoino.py +399 -0
- ccxt/exir.py +375 -0
- ccxt/exmo.py +2462 -0
- ccxt/exnovin.py +360 -0
- ccxt/farhadexchange.py +266 -0
- ccxt/fmfwio.py +34 -0
- ccxt/gate.py +6975 -0
- ccxt/gateio.py +16 -0
- ccxt/gemini.py +1824 -0
- ccxt/hashkey.py +4150 -0
- ccxt/hitbtc.py +3423 -0
- ccxt/hitbtc3.py +16 -0
- ccxt/hitobit.py +391 -0
- ccxt/hollaex.py +1813 -0
- ccxt/htx.py +8505 -0
- ccxt/huobi.py +16 -0
- ccxt/huobijp.py +1801 -0
- ccxt/hyperliquid.py +2430 -0
- ccxt/idex.py +1766 -0
- ccxt/independentreserve.py +784 -0
- ccxt/indodax.py +1247 -0
- ccxt/jibitex.py +395 -0
- ccxt/kraken.py +2894 -0
- ccxt/krakenfutures.py +2601 -0
- ccxt/kucoin.py +4601 -0
- ccxt/kucoinfutures.py +2698 -0
- ccxt/kuna.py +1841 -0
- ccxt/latoken.py +1664 -0
- ccxt/lbank.py +2682 -0
- ccxt/luno.py +1067 -0
- ccxt/lykke.py +1270 -0
- ccxt/mercado.py +842 -0
- ccxt/mexc.py +5369 -0
- ccxt/ndax.py +2354 -0
- ccxt/nobitex.py +419 -0
- ccxt/novadax.py +1484 -0
- ccxt/oceanex.py +903 -0
- ccxt/okcoin.py +2936 -0
- ccxt/okexchange.py +349 -0
- ccxt/okx.py +7826 -0
- ccxt/ompfinex.py +472 -0
- ccxt/onetrading.py +1911 -0
- ccxt/oxfun.py +2772 -0
- ccxt/p2b.py +1194 -0
- ccxt/paradex.py +2015 -0
- ccxt/paymium.py +564 -0
- ccxt/phemex.py +4473 -0
- ccxt/poloniex.py +2232 -0
- ccxt/poloniexfutures.py +1717 -0
- ccxt/pro/__init__.py +149 -0
- ccxt/pro/alpaca.py +685 -0
- ccxt/pro/ascendex.py +916 -0
- ccxt/pro/bequant.py +38 -0
- ccxt/pro/binance.py +3488 -0
- ccxt/pro/binancecoinm.py +28 -0
- ccxt/pro/binanceus.py +48 -0
- ccxt/pro/binanceusdm.py +31 -0
- ccxt/pro/bingx.py +1264 -0
- ccxt/pro/bitcoincom.py +34 -0
- ccxt/pro/bitfinex.py +621 -0
- ccxt/pro/bitfinex2.py +1083 -0
- ccxt/pro/bitget.py +1692 -0
- ccxt/pro/bithumb.py +368 -0
- ccxt/pro/bitmart.py +1449 -0
- ccxt/pro/bitmex.py +1656 -0
- ccxt/pro/bitopro.py +445 -0
- ccxt/pro/bitpanda.py +15 -0
- ccxt/pro/bitrue.py +447 -0
- ccxt/pro/bitstamp.py +522 -0
- ccxt/pro/bitvavo.py +1270 -0
- ccxt/pro/blockchaincom.py +738 -0
- ccxt/pro/blofin.py +692 -0
- ccxt/pro/bybit.py +2000 -0
- ccxt/pro/cex.py +1440 -0
- ccxt/pro/coinbase.py +678 -0
- ccxt/pro/coinbaseadvanced.py +16 -0
- ccxt/pro/coinbaseexchange.py +895 -0
- ccxt/pro/coinbaseinternational.py +620 -0
- ccxt/pro/coincatch.py +1464 -0
- ccxt/pro/coincheck.py +199 -0
- ccxt/pro/coinex.py +1061 -0
- ccxt/pro/coinone.py +395 -0
- ccxt/pro/cryptocom.py +947 -0
- ccxt/pro/currencycom.py +536 -0
- ccxt/pro/deribit.py +892 -0
- ccxt/pro/exmo.py +629 -0
- ccxt/pro/gate.py +1416 -0
- ccxt/pro/gateio.py +15 -0
- ccxt/pro/gemini.py +865 -0
- ccxt/pro/hashkey.py +802 -0
- ccxt/pro/hitbtc.py +1216 -0
- ccxt/pro/hollaex.py +563 -0
- ccxt/pro/htx.py +2215 -0
- ccxt/pro/huobi.py +15 -0
- ccxt/pro/huobijp.py +570 -0
- ccxt/pro/hyperliquid.py +525 -0
- ccxt/pro/idex.py +672 -0
- ccxt/pro/independentreserve.py +270 -0
- ccxt/pro/kraken.py +1356 -0
- ccxt/pro/krakenfutures.py +1492 -0
- ccxt/pro/kucoin.py +1133 -0
- ccxt/pro/kucoinfutures.py +1081 -0
- ccxt/pro/lbank.py +843 -0
- ccxt/pro/luno.py +303 -0
- ccxt/pro/mexc.py +1122 -0
- ccxt/pro/ndax.py +506 -0
- ccxt/pro/okcoin.py +698 -0
- ccxt/pro/okx.py +1851 -0
- ccxt/pro/onetrading.py +1275 -0
- ccxt/pro/oxfun.py +950 -0
- ccxt/pro/p2b.py +419 -0
- ccxt/pro/paradex.py +352 -0
- ccxt/pro/phemex.py +1441 -0
- ccxt/pro/poloniex.py +1166 -0
- ccxt/pro/poloniexfutures.py +990 -0
- ccxt/pro/probit.py +551 -0
- ccxt/pro/upbit.py +520 -0
- ccxt/pro/vertex.py +943 -0
- ccxt/pro/wazirx.py +749 -0
- ccxt/pro/whitebit.py +864 -0
- ccxt/pro/woo.py +1078 -0
- ccxt/pro/woofipro.py +1183 -0
- ccxt/pro/xt.py +1067 -0
- ccxt/probit.py +1734 -0
- ccxt/ramzinex.py +476 -0
- ccxt/sarmayex.py +357 -0
- ccxt/sarrafex.py +478 -0
- ccxt/static_dependencies/__init__.py +1 -0
- ccxt/static_dependencies/ecdsa/__init__.py +14 -0
- ccxt/static_dependencies/ecdsa/_version.py +520 -0
- ccxt/static_dependencies/ecdsa/curves.py +56 -0
- ccxt/static_dependencies/ecdsa/der.py +221 -0
- ccxt/static_dependencies/ecdsa/ecdsa.py +310 -0
- ccxt/static_dependencies/ecdsa/ellipticcurve.py +197 -0
- ccxt/static_dependencies/ecdsa/keys.py +332 -0
- ccxt/static_dependencies/ecdsa/numbertheory.py +531 -0
- ccxt/static_dependencies/ecdsa/rfc6979.py +100 -0
- ccxt/static_dependencies/ecdsa/util.py +266 -0
- ccxt/static_dependencies/ethereum/__init__.py +7 -0
- ccxt/static_dependencies/ethereum/abi/__init__.py +16 -0
- ccxt/static_dependencies/ethereum/abi/abi.py +19 -0
- ccxt/static_dependencies/ethereum/abi/base.py +152 -0
- ccxt/static_dependencies/ethereum/abi/codec.py +217 -0
- ccxt/static_dependencies/ethereum/abi/constants.py +3 -0
- ccxt/static_dependencies/ethereum/abi/decoding.py +565 -0
- ccxt/static_dependencies/ethereum/abi/encoding.py +720 -0
- ccxt/static_dependencies/ethereum/abi/exceptions.py +139 -0
- ccxt/static_dependencies/ethereum/abi/grammar.py +443 -0
- ccxt/static_dependencies/ethereum/abi/packed.py +13 -0
- ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- ccxt/static_dependencies/ethereum/abi/registry.py +643 -0
- ccxt/static_dependencies/ethereum/abi/tools/__init__.py +3 -0
- ccxt/static_dependencies/ethereum/abi/tools/_strategies.py +230 -0
- ccxt/static_dependencies/ethereum/abi/utils/__init__.py +0 -0
- ccxt/static_dependencies/ethereum/abi/utils/numeric.py +83 -0
- ccxt/static_dependencies/ethereum/abi/utils/padding.py +27 -0
- ccxt/static_dependencies/ethereum/abi/utils/string.py +19 -0
- ccxt/static_dependencies/ethereum/account/__init__.py +3 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/__init__.py +4 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/encoding_and_hashing.py +239 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/helpers.py +40 -0
- ccxt/static_dependencies/ethereum/account/messages.py +263 -0
- ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- ccxt/static_dependencies/ethereum/hexbytes/__init__.py +5 -0
- ccxt/static_dependencies/ethereum/hexbytes/_utils.py +54 -0
- ccxt/static_dependencies/ethereum/hexbytes/main.py +65 -0
- ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- ccxt/static_dependencies/ethereum/typing/__init__.py +63 -0
- ccxt/static_dependencies/ethereum/typing/abi.py +6 -0
- ccxt/static_dependencies/ethereum/typing/bls.py +7 -0
- ccxt/static_dependencies/ethereum/typing/discovery.py +5 -0
- ccxt/static_dependencies/ethereum/typing/encoding.py +7 -0
- ccxt/static_dependencies/ethereum/typing/enums.py +17 -0
- ccxt/static_dependencies/ethereum/typing/ethpm.py +9 -0
- ccxt/static_dependencies/ethereum/typing/evm.py +20 -0
- ccxt/static_dependencies/ethereum/typing/networks.py +1122 -0
- ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/__init__.py +115 -0
- ccxt/static_dependencies/ethereum/utils/abi.py +72 -0
- ccxt/static_dependencies/ethereum/utils/address.py +171 -0
- ccxt/static_dependencies/ethereum/utils/applicators.py +151 -0
- ccxt/static_dependencies/ethereum/utils/conversions.py +190 -0
- ccxt/static_dependencies/ethereum/utils/currency.py +107 -0
- ccxt/static_dependencies/ethereum/utils/curried/__init__.py +269 -0
- ccxt/static_dependencies/ethereum/utils/debug.py +20 -0
- ccxt/static_dependencies/ethereum/utils/decorators.py +132 -0
- ccxt/static_dependencies/ethereum/utils/encoding.py +6 -0
- ccxt/static_dependencies/ethereum/utils/exceptions.py +4 -0
- ccxt/static_dependencies/ethereum/utils/functional.py +75 -0
- ccxt/static_dependencies/ethereum/utils/hexadecimal.py +74 -0
- ccxt/static_dependencies/ethereum/utils/humanize.py +188 -0
- ccxt/static_dependencies/ethereum/utils/logging.py +159 -0
- ccxt/static_dependencies/ethereum/utils/module_loading.py +31 -0
- ccxt/static_dependencies/ethereum/utils/numeric.py +43 -0
- ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/toolz.py +76 -0
- ccxt/static_dependencies/ethereum/utils/types.py +54 -0
- ccxt/static_dependencies/ethereum/utils/typing/__init__.py +18 -0
- ccxt/static_dependencies/ethereum/utils/typing/misc.py +14 -0
- ccxt/static_dependencies/ethereum/utils/units.py +31 -0
- ccxt/static_dependencies/keccak/__init__.py +3 -0
- ccxt/static_dependencies/keccak/keccak.py +197 -0
- ccxt/static_dependencies/lark/__init__.py +38 -0
- ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
- ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
- ccxt/static_dependencies/lark/ast_utils.py +59 -0
- ccxt/static_dependencies/lark/common.py +86 -0
- ccxt/static_dependencies/lark/exceptions.py +292 -0
- ccxt/static_dependencies/lark/grammar.py +130 -0
- ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
- ccxt/static_dependencies/lark/indenter.py +143 -0
- ccxt/static_dependencies/lark/lark.py +658 -0
- ccxt/static_dependencies/lark/lexer.py +678 -0
- ccxt/static_dependencies/lark/load_grammar.py +1428 -0
- ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
- ccxt/static_dependencies/lark/parser_frontends.py +257 -0
- ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
- ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
- ccxt/static_dependencies/lark/parsers/earley.py +314 -0
- ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
- ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
- ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
- ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
- ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
- ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
- ccxt/static_dependencies/lark/reconstruct.py +107 -0
- ccxt/static_dependencies/lark/tools/__init__.py +70 -0
- ccxt/static_dependencies/lark/tools/nearley.py +202 -0
- ccxt/static_dependencies/lark/tools/serialize.py +32 -0
- ccxt/static_dependencies/lark/tools/standalone.py +196 -0
- ccxt/static_dependencies/lark/tree.py +267 -0
- ccxt/static_dependencies/lark/tree_matcher.py +186 -0
- ccxt/static_dependencies/lark/tree_templates.py +180 -0
- ccxt/static_dependencies/lark/utils.py +343 -0
- ccxt/static_dependencies/lark/visitors.py +596 -0
- ccxt/static_dependencies/marshmallow/__init__.py +81 -0
- ccxt/static_dependencies/marshmallow/base.py +65 -0
- ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
- ccxt/static_dependencies/marshmallow/decorators.py +231 -0
- ccxt/static_dependencies/marshmallow/error_store.py +60 -0
- ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
- ccxt/static_dependencies/marshmallow/fields.py +2114 -0
- ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
- ccxt/static_dependencies/marshmallow/schema.py +1228 -0
- ccxt/static_dependencies/marshmallow/types.py +12 -0
- ccxt/static_dependencies/marshmallow/utils.py +378 -0
- ccxt/static_dependencies/marshmallow/validate.py +678 -0
- ccxt/static_dependencies/marshmallow/warnings.py +2 -0
- ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
- ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
- ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
- ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
- ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
- ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
- ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
- ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
- ccxt/static_dependencies/msgpack/__init__.py +55 -0
- ccxt/static_dependencies/msgpack/exceptions.py +48 -0
- ccxt/static_dependencies/msgpack/ext.py +168 -0
- ccxt/static_dependencies/msgpack/fallback.py +951 -0
- ccxt/static_dependencies/parsimonious/__init__.py +10 -0
- ccxt/static_dependencies/parsimonious/exceptions.py +105 -0
- ccxt/static_dependencies/parsimonious/expressions.py +479 -0
- ccxt/static_dependencies/parsimonious/grammar.py +487 -0
- ccxt/static_dependencies/parsimonious/nodes.py +325 -0
- ccxt/static_dependencies/parsimonious/utils.py +40 -0
- ccxt/static_dependencies/starknet/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
- ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
- ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
- ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
- ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
- ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
- ccxt/static_dependencies/starknet/common.py +15 -0
- ccxt/static_dependencies/starknet/constants.py +39 -0
- ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
- ccxt/static_dependencies/starknet/hash/address.py +79 -0
- ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
- ccxt/static_dependencies/starknet/hash/selector.py +16 -0
- ccxt/static_dependencies/starknet/hash/storage.py +12 -0
- ccxt/static_dependencies/starknet/hash/utils.py +78 -0
- ccxt/static_dependencies/starknet/models/__init__.py +0 -0
- ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
- ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
- ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
- ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
- ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
- ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
- ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
- ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
- ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
- ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
- ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
- ccxt/static_dependencies/starknet/utils/schema.py +13 -0
- ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
- ccxt/static_dependencies/starkware/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
- ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
- ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
- ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
- ccxt/static_dependencies/sympy/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
- ccxt/static_dependencies/sympy/external/__init__.py +0 -0
- ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
- ccxt/static_dependencies/sympy/external/importtools.py +187 -0
- ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
- ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
- ccxt/static_dependencies/toolz/__init__.py +26 -0
- ccxt/static_dependencies/toolz/_signatures.py +784 -0
- ccxt/static_dependencies/toolz/_version.py +520 -0
- ccxt/static_dependencies/toolz/compatibility.py +30 -0
- ccxt/static_dependencies/toolz/curried/__init__.py +101 -0
- ccxt/static_dependencies/toolz/curried/exceptions.py +22 -0
- ccxt/static_dependencies/toolz/curried/operator.py +22 -0
- ccxt/static_dependencies/toolz/dicttoolz.py +339 -0
- ccxt/static_dependencies/toolz/functoolz.py +1049 -0
- ccxt/static_dependencies/toolz/itertoolz.py +1057 -0
- ccxt/static_dependencies/toolz/recipes.py +46 -0
- ccxt/static_dependencies/toolz/utils.py +9 -0
- ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
- ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
- ccxt/tabdeal.py +364 -0
- ccxt/test/__init__.py +3 -0
- ccxt/test/base/__init__.py +29 -0
- ccxt/test/base/test_account.py +26 -0
- ccxt/test/base/test_balance.py +56 -0
- ccxt/test/base/test_borrow_interest.py +35 -0
- ccxt/test/base/test_borrow_rate.py +32 -0
- ccxt/test/base/test_calculate_fee.py +51 -0
- ccxt/test/base/test_crypto.py +127 -0
- ccxt/test/base/test_currency.py +76 -0
- ccxt/test/base/test_datetime.py +109 -0
- ccxt/test/base/test_decimal_to_precision.py +392 -0
- ccxt/test/base/test_deep_extend.py +68 -0
- ccxt/test/base/test_deposit_withdrawal.py +50 -0
- ccxt/test/base/test_exchange_datetime_functions.py +76 -0
- ccxt/test/base/test_funding_rate_history.py +29 -0
- ccxt/test/base/test_last_price.py +31 -0
- ccxt/test/base/test_ledger_entry.py +45 -0
- ccxt/test/base/test_ledger_item.py +48 -0
- ccxt/test/base/test_leverage_tier.py +33 -0
- ccxt/test/base/test_liquidation.py +50 -0
- ccxt/test/base/test_margin_mode.py +24 -0
- ccxt/test/base/test_margin_modification.py +35 -0
- ccxt/test/base/test_market.py +193 -0
- ccxt/test/base/test_number.py +411 -0
- ccxt/test/base/test_ohlcv.py +33 -0
- ccxt/test/base/test_open_interest.py +32 -0
- ccxt/test/base/test_order.py +64 -0
- ccxt/test/base/test_order_book.py +69 -0
- ccxt/test/base/test_position.py +60 -0
- ccxt/test/base/test_shared_methods.py +353 -0
- ccxt/test/base/test_status.py +24 -0
- ccxt/test/base/test_throttle.py +126 -0
- ccxt/test/base/test_ticker.py +92 -0
- ccxt/test/base/test_trade.py +47 -0
- ccxt/test/base/test_trading_fee.py +26 -0
- ccxt/test/base/test_transaction.py +39 -0
- ccxt/test/test_async.py +1649 -0
- ccxt/test/test_sync.py +1648 -0
- ccxt/test/tests_async.py +1558 -0
- ccxt/test/tests_helpers.py +287 -0
- ccxt/test/tests_init.py +39 -0
- ccxt/test/tests_sync.py +1555 -0
- ccxt/tetherland.py +349 -0
- ccxt/timex.py +1593 -0
- ccxt/tokocrypto.py +2405 -0
- ccxt/tradeogre.py +608 -0
- ccxt/twox.py +326 -0
- ccxt/ubitex.py +409 -0
- ccxt/upbit.py +1833 -0
- ccxt/vertex.py +2922 -0
- ccxt/wallex.py +445 -0
- ccxt/wavesexchange.py +2472 -0
- ccxt/wazirx.py +1224 -0
- ccxt/whitebit.py +2469 -0
- ccxt/woo.py +3114 -0
- ccxt/woofipro.py +2533 -0
- ccxt/xt.py +4453 -0
- ccxt/yobit.py +1283 -0
- ccxt/zaif.py +725 -0
- ccxt/zonda.py +1828 -0
- ccxt_ir-4.3.46.0.1.dist-info/LICENSE.txt +21 -0
- ccxt_ir-4.3.46.0.1.dist-info/METADATA +655 -0
- ccxt_ir-4.3.46.0.1.dist-info/RECORD +772 -0
- ccxt_ir-4.3.46.0.1.dist-info/WHEEL +6 -0
- ccxt_ir-4.3.46.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
from __future__ import division
|
|
2
|
+
|
|
3
|
+
import binascii
|
|
4
|
+
import base64
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class UnexpectedDER(Exception):
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def encode_constructed(tag, value):
|
|
12
|
+
return int.to_bytes(0xa0+tag, 1, 'big') + encode_length(len(value)) + value
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def encode_integer(r):
|
|
16
|
+
assert r >= 0 # can't support negative numbers yet
|
|
17
|
+
h = ("%x" % r).encode()
|
|
18
|
+
if len(h) % 2:
|
|
19
|
+
h = b'0' + h
|
|
20
|
+
s = binascii.unhexlify(h)
|
|
21
|
+
num = s[0] if isinstance(s[0], int) else ord(s[0])
|
|
22
|
+
if num <= 0x7f:
|
|
23
|
+
return b'\x02' + int.to_bytes(len(s), 1, 'big') + s
|
|
24
|
+
else:
|
|
25
|
+
# DER integers are two's complement, so if the first byte is
|
|
26
|
+
# 0x80-0xff then we need an extra 0x00 byte to prevent it from
|
|
27
|
+
# looking negative.
|
|
28
|
+
return b'\x02' + int.to_bytes(len(s)+1, 1, 'big') + b'\x00' + s
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def encode_bitstring(s):
|
|
32
|
+
return b'\x03' + encode_length(len(s)) + s
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def encode_octet_string(s):
|
|
36
|
+
return b'\x04' + encode_length(len(s)) + s
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def encode_oid(first, second, *pieces):
|
|
40
|
+
assert first <= 2
|
|
41
|
+
assert second <= 39
|
|
42
|
+
encoded_pieces = [int.to_bytes(40*first+second, 1, 'big')] + [encode_number(p)
|
|
43
|
+
for p in pieces]
|
|
44
|
+
body = b''.join(encoded_pieces)
|
|
45
|
+
return b'\x06' + encode_length(len(body)) + body
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def encode_sequence(*encoded_pieces):
|
|
49
|
+
total_len = sum([len(p) for p in encoded_pieces])
|
|
50
|
+
return b'\x30' + encode_length(total_len) + b''.join(encoded_pieces)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def encode_number(n):
|
|
54
|
+
b128_digits = []
|
|
55
|
+
while n:
|
|
56
|
+
b128_digits.insert(0, (n & 0x7f) | 0x80)
|
|
57
|
+
n = n >> 7
|
|
58
|
+
if not b128_digits:
|
|
59
|
+
b128_digits.append(0)
|
|
60
|
+
b128_digits[-1] &= 0x7f
|
|
61
|
+
return b''.join([int.to_bytes(d, 1, 'big') for d in b128_digits])
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def remove_constructed(string):
|
|
65
|
+
s0 = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
66
|
+
if (s0 & 0xe0) != 0xa0:
|
|
67
|
+
raise UnexpectedDER("wanted constructed tag (0xa0-0xbf), got 0x%02x"
|
|
68
|
+
% s0)
|
|
69
|
+
tag = s0 & 0x1f
|
|
70
|
+
length, llen = read_length(string[1:])
|
|
71
|
+
body = string[1+llen:1+llen+length]
|
|
72
|
+
rest = string[1+llen+length:]
|
|
73
|
+
return tag, body, rest
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def remove_sequence(string):
|
|
77
|
+
if not string.startswith(b'\x30'):
|
|
78
|
+
n = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
79
|
+
raise UnexpectedDER("wanted sequence (0x30), got 0x%02x" % n)
|
|
80
|
+
length, lengthlength = read_length(string[1:])
|
|
81
|
+
endseq = 1+lengthlength+length
|
|
82
|
+
return string[1+lengthlength:endseq], string[endseq:]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def remove_octet_string(string):
|
|
86
|
+
if not string.startswith(b'\x04'):
|
|
87
|
+
n = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
88
|
+
raise UnexpectedDER("wanted octetstring (0x04), got 0x%02x" % n)
|
|
89
|
+
length, llen = read_length(string[1:])
|
|
90
|
+
body = string[1+llen:1+llen+length]
|
|
91
|
+
rest = string[1+llen+length:]
|
|
92
|
+
return body, rest
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def remove_object(string):
|
|
96
|
+
if not string.startswith(b'\x06'):
|
|
97
|
+
n = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
98
|
+
raise UnexpectedDER("wanted object (0x06), got 0x%02x" % n)
|
|
99
|
+
length, lengthlength = read_length(string[1:])
|
|
100
|
+
body = string[1+lengthlength:1+lengthlength+length]
|
|
101
|
+
rest = string[1+lengthlength+length:]
|
|
102
|
+
numbers = []
|
|
103
|
+
while body:
|
|
104
|
+
n, ll = read_number(body)
|
|
105
|
+
numbers.append(n)
|
|
106
|
+
body = body[ll:]
|
|
107
|
+
n0 = numbers.pop(0)
|
|
108
|
+
first = n0//40
|
|
109
|
+
second = n0-(40*first)
|
|
110
|
+
numbers.insert(0, first)
|
|
111
|
+
numbers.insert(1, second)
|
|
112
|
+
return tuple(numbers), rest
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def remove_integer(string):
|
|
116
|
+
if not string.startswith(b'\x02'):
|
|
117
|
+
n = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
118
|
+
raise UnexpectedDER("wanted integer (0x02), got 0x%02x" % n)
|
|
119
|
+
length, llen = read_length(string[1:])
|
|
120
|
+
numberbytes = string[1+llen:1+llen+length]
|
|
121
|
+
rest = string[1+llen+length:]
|
|
122
|
+
nbytes = numberbytes[0] if isinstance(numberbytes[0], int) else ord(numberbytes[0])
|
|
123
|
+
assert nbytes < 0x80 # can't support negative numbers yet
|
|
124
|
+
return int(binascii.hexlify(numberbytes), 16), rest
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def read_number(string):
|
|
128
|
+
number = 0
|
|
129
|
+
llen = 0
|
|
130
|
+
# base-128 big endian, with b7 set in all but the last byte
|
|
131
|
+
while True:
|
|
132
|
+
if llen > len(string):
|
|
133
|
+
raise UnexpectedDER("ran out of length bytes")
|
|
134
|
+
number = number << 7
|
|
135
|
+
d = string[llen] if isinstance(string[llen], int) else ord(string[llen])
|
|
136
|
+
number += (d & 0x7f)
|
|
137
|
+
llen += 1
|
|
138
|
+
if not d & 0x80:
|
|
139
|
+
break
|
|
140
|
+
return number, llen
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def encode_length(l):
|
|
144
|
+
assert l >= 0
|
|
145
|
+
if l < 0x80:
|
|
146
|
+
return int.to_bytes(l, 1, 'big')
|
|
147
|
+
s = ("%x" % l).encode()
|
|
148
|
+
if len(s) % 2:
|
|
149
|
+
s = b'0' + s
|
|
150
|
+
s = binascii.unhexlify(s)
|
|
151
|
+
llen = len(s)
|
|
152
|
+
return int.to_bytes(0x80 | llen, 1, 'big') + s
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def read_length(string):
|
|
156
|
+
num = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
157
|
+
if not (num & 0x80):
|
|
158
|
+
# short form
|
|
159
|
+
return (num & 0x7f), 1
|
|
160
|
+
# else long-form: b0&0x7f is number of additional base256 length bytes,
|
|
161
|
+
# big-endian
|
|
162
|
+
llen = num & 0x7f
|
|
163
|
+
if llen > len(string)-1:
|
|
164
|
+
raise UnexpectedDER("ran out of length bytes")
|
|
165
|
+
return int(binascii.hexlify(string[1:1+llen]), 16), 1+llen
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def remove_bitstring(string):
|
|
169
|
+
num = string[0] if isinstance(string[0], int) else ord(string[0])
|
|
170
|
+
if not string.startswith(b'\x03'):
|
|
171
|
+
raise UnexpectedDER("wanted bitstring (0x03), got 0x%02x" % num)
|
|
172
|
+
length, llen = read_length(string[1:])
|
|
173
|
+
body = string[1+llen:1+llen+length]
|
|
174
|
+
rest = string[1+llen+length:]
|
|
175
|
+
return body, rest
|
|
176
|
+
|
|
177
|
+
# SEQUENCE([1, STRING(secexp), cont[0], OBJECT(curvename), cont[1], BINTSTRING)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
# signatures: (from RFC3279)
|
|
181
|
+
# ansi-X9-62 OBJECT IDENTIFIER ::= {
|
|
182
|
+
# iso(1) member-body(2) us(840) 10045 }
|
|
183
|
+
#
|
|
184
|
+
# id-ecSigType OBJECT IDENTIFIER ::= {
|
|
185
|
+
# ansi-X9-62 signatures(4) }
|
|
186
|
+
# ecdsa-with-SHA1 OBJECT IDENTIFIER ::= {
|
|
187
|
+
# id-ecSigType 1 }
|
|
188
|
+
## so 1,2,840,10045,4,1
|
|
189
|
+
## so 0x42, .. ..
|
|
190
|
+
|
|
191
|
+
# Ecdsa-Sig-Value ::= SEQUENCE {
|
|
192
|
+
# r INTEGER,
|
|
193
|
+
# s INTEGER }
|
|
194
|
+
|
|
195
|
+
# id-public-key-type OBJECT IDENTIFIER ::= { ansi-X9.62 2 }
|
|
196
|
+
#
|
|
197
|
+
# id-ecPublicKey OBJECT IDENTIFIER ::= { id-publicKeyType 1 }
|
|
198
|
+
|
|
199
|
+
# I think the secp224r1 identifier is (t=06,l=05,v=2b81040021)
|
|
200
|
+
# secp224r1 OBJECT IDENTIFIER ::= {
|
|
201
|
+
# iso(1) identified-organization(3) certicom(132) curve(0) 33 }
|
|
202
|
+
# and the secp384r1 is (t=06,l=05,v=2b81040022)
|
|
203
|
+
# secp384r1 OBJECT IDENTIFIER ::= {
|
|
204
|
+
# iso(1) identified-organization(3) certicom(132) curve(0) 34 }
|
|
205
|
+
|
|
206
|
+
def unpem(pem):
|
|
207
|
+
if isinstance(pem, str):
|
|
208
|
+
pem = pem.encode()
|
|
209
|
+
|
|
210
|
+
d = b''.join([l.strip() for l in pem.split(b'\n')
|
|
211
|
+
if l and not l.startswith(b'-----')])
|
|
212
|
+
return base64.b64decode(d)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def topem(der, name):
|
|
216
|
+
b64 = base64.b64encode(der)
|
|
217
|
+
lines = [("-----BEGIN %s-----\n" % name).encode()]
|
|
218
|
+
lines.extend([b64[start:start+64]+b'\n'
|
|
219
|
+
for start in range(0, len(b64), 64)])
|
|
220
|
+
lines.append(("-----END %s-----\n" % name).encode())
|
|
221
|
+
return b''.join(lines)
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
#! /usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Implementation of Elliptic-Curve Digital Signatures.
|
|
5
|
+
|
|
6
|
+
Classes and methods for elliptic-curve signatures:
|
|
7
|
+
private keys, public keys, signatures,
|
|
8
|
+
NIST prime-modulus curves with modulus lengths of
|
|
9
|
+
192, 224, 256, 384, and 521 bits.
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
|
|
13
|
+
# (In real-life applications, you would probably want to
|
|
14
|
+
# protect against defects in SystemRandom.)
|
|
15
|
+
from random import SystemRandom
|
|
16
|
+
randrange = SystemRandom().randrange
|
|
17
|
+
|
|
18
|
+
# Generate a public/private key pair using the NIST Curve P-192:
|
|
19
|
+
|
|
20
|
+
g = generator_192
|
|
21
|
+
n = g.order()
|
|
22
|
+
secret = randrange( 1, n )
|
|
23
|
+
pubkey = Public_key( g, g * secret )
|
|
24
|
+
privkey = Private_key( pubkey, secret )
|
|
25
|
+
|
|
26
|
+
# Signing a hash value:
|
|
27
|
+
|
|
28
|
+
hash = randrange( 1, n )
|
|
29
|
+
signature = privkey.sign( hash, randrange( 1, n ) )
|
|
30
|
+
|
|
31
|
+
# Verifying a signature for a hash value:
|
|
32
|
+
|
|
33
|
+
if pubkey.verifies( hash, signature ):
|
|
34
|
+
print_("Demo verification succeeded.")
|
|
35
|
+
else:
|
|
36
|
+
print_("*** Demo verification failed.")
|
|
37
|
+
|
|
38
|
+
# Verification fails if the hash value is modified:
|
|
39
|
+
|
|
40
|
+
if pubkey.verifies( hash-1, signature ):
|
|
41
|
+
print_("**** Demo verification failed to reject tampered hash.")
|
|
42
|
+
else:
|
|
43
|
+
print_("Demo verification correctly rejected tampered hash.")
|
|
44
|
+
|
|
45
|
+
Version of 2009.05.16.
|
|
46
|
+
|
|
47
|
+
Revision history:
|
|
48
|
+
2005.12.31 - Initial version.
|
|
49
|
+
2008.11.25 - Substantial revisions introducing new classes.
|
|
50
|
+
2009.05.16 - Warn against using random.randrange in real applications.
|
|
51
|
+
2009.05.17 - Use random.SystemRandom by default.
|
|
52
|
+
|
|
53
|
+
Written in 2005 by Peter Pearson and placed in the public domain.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
from . import ellipticcurve
|
|
57
|
+
from . import numbertheory
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class RSZeroError(RuntimeError):
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class Signature(object):
|
|
65
|
+
"""ECDSA signature.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def __init__(self, r, s, recovery_param):
|
|
69
|
+
self.r = r
|
|
70
|
+
self.s = s
|
|
71
|
+
self.recovery_param = recovery_param
|
|
72
|
+
|
|
73
|
+
def recover_public_keys(self, hash, generator):
|
|
74
|
+
"""Returns two public keys for which the signature is valid
|
|
75
|
+
hash is signed hash
|
|
76
|
+
generator is the used generator of the signature
|
|
77
|
+
"""
|
|
78
|
+
curve = generator.curve()
|
|
79
|
+
n = generator.order()
|
|
80
|
+
r = self.r
|
|
81
|
+
s = self.s
|
|
82
|
+
e = hash
|
|
83
|
+
x = r
|
|
84
|
+
|
|
85
|
+
# Compute the curve point with x as x-coordinate
|
|
86
|
+
alpha = (pow(x, 3, curve.p()) + (curve.a() * x) + curve.b()) % curve.p()
|
|
87
|
+
beta = numbertheory.square_root_mod_prime(alpha, curve.p())
|
|
88
|
+
y = beta if beta % 2 == 0 else curve.p() - beta
|
|
89
|
+
|
|
90
|
+
# Compute the public key
|
|
91
|
+
R1 = ellipticcurve.Point(curve, x, y, n)
|
|
92
|
+
Q1 = numbertheory.inverse_mod(r, n) * (s * R1 + (-e % n) * generator)
|
|
93
|
+
Pk1 = Public_key(generator, Q1)
|
|
94
|
+
|
|
95
|
+
# And the second solution
|
|
96
|
+
R2 = ellipticcurve.Point(curve, x, -y, n)
|
|
97
|
+
Q2 = numbertheory.inverse_mod(r, n) * (s * R2 + (-e % n) * generator)
|
|
98
|
+
Pk2 = Public_key(generator, Q2)
|
|
99
|
+
|
|
100
|
+
return [Pk1, Pk2]
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class Public_key(object):
|
|
104
|
+
"""Public key for ECDSA.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
def __init__(self, generator, point):
|
|
108
|
+
"""generator is the Point that generates the group,
|
|
109
|
+
point is the Point that defines the public key.
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
self.curve = generator.curve()
|
|
113
|
+
self.generator = generator
|
|
114
|
+
self.point = point
|
|
115
|
+
n = generator.order()
|
|
116
|
+
if not n:
|
|
117
|
+
raise RuntimeError("Generator point must have order.")
|
|
118
|
+
if not n * point == ellipticcurve.INFINITY:
|
|
119
|
+
raise RuntimeError("Generator point order is bad.")
|
|
120
|
+
if point.x() < 0 or n <= point.x() or point.y() < 0 or n <= point.y():
|
|
121
|
+
raise RuntimeError("Generator point has x or y out of range.")
|
|
122
|
+
|
|
123
|
+
def verifies(self, hash, signature):
|
|
124
|
+
"""Verify that signature is a valid signature of hash.
|
|
125
|
+
Return True if the signature is valid.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
# From X9.62 J.3.1.
|
|
129
|
+
|
|
130
|
+
G = self.generator
|
|
131
|
+
n = G.order()
|
|
132
|
+
r = signature.r
|
|
133
|
+
s = signature.s
|
|
134
|
+
if r < 1 or r > n - 1:
|
|
135
|
+
return False
|
|
136
|
+
if s < 1 or s > n - 1:
|
|
137
|
+
return False
|
|
138
|
+
c = numbertheory.inverse_mod(s, n)
|
|
139
|
+
u1 = (hash * c) % n
|
|
140
|
+
u2 = (r * c) % n
|
|
141
|
+
xy = u1 * G + u2 * self.point
|
|
142
|
+
v = xy.x() % n
|
|
143
|
+
return v == r
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class Private_key(object):
|
|
147
|
+
"""Private key for ECDSA.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
def __init__(self, public_key, secret_multiplier):
|
|
151
|
+
"""public_key is of class Public_key;
|
|
152
|
+
secret_multiplier is a large integer.
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
self.public_key = public_key
|
|
156
|
+
self.secret_multiplier = secret_multiplier
|
|
157
|
+
|
|
158
|
+
def sign(self, hash, random_k):
|
|
159
|
+
"""Return a signature for the provided hash, using the provided
|
|
160
|
+
random nonce. It is absolutely vital that random_k be an unpredictable
|
|
161
|
+
number in the range [1, self.public_key.point.order()-1]. If
|
|
162
|
+
an attacker can guess random_k, he can compute our private key from a
|
|
163
|
+
single signature. Also, if an attacker knows a few high-order
|
|
164
|
+
bits (or a few low-order bits) of random_k, he can compute our private
|
|
165
|
+
key from many signatures. The generation of nonces with adequate
|
|
166
|
+
cryptographic strength is very difficult and far beyond the scope
|
|
167
|
+
of this comment.
|
|
168
|
+
|
|
169
|
+
May raise RuntimeError, in which case retrying with a new
|
|
170
|
+
random value k is in order.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
G = self.public_key.generator
|
|
174
|
+
n = G.order()
|
|
175
|
+
k = random_k % n
|
|
176
|
+
p1 = k * G
|
|
177
|
+
r = p1.x() % n
|
|
178
|
+
if r == 0:
|
|
179
|
+
raise RSZeroError("amazingly unlucky random number r")
|
|
180
|
+
s = (numbertheory.inverse_mod(k, n) *
|
|
181
|
+
(hash + (self.secret_multiplier * r) % n)) % n
|
|
182
|
+
if s == 0:
|
|
183
|
+
raise RSZeroError("amazingly unlucky random number s")
|
|
184
|
+
recovery_param = p1.y() % 2 or (2 if p1.x() == k else 0)
|
|
185
|
+
return Signature(r, s, recovery_param)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def int_to_string(x):
|
|
189
|
+
"""Convert integer x into a string of bytes, as per X9.62."""
|
|
190
|
+
assert x >= 0
|
|
191
|
+
if x == 0:
|
|
192
|
+
return b'\0'
|
|
193
|
+
result = []
|
|
194
|
+
while x:
|
|
195
|
+
ordinal = x & 0xFF
|
|
196
|
+
result.append(int.to_bytes(ordinal, 1, 'big'))
|
|
197
|
+
x >>= 8
|
|
198
|
+
|
|
199
|
+
result.reverse()
|
|
200
|
+
return b''.join(result)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def string_to_int(s):
|
|
204
|
+
"""Convert a string of bytes into an integer, as per X9.62."""
|
|
205
|
+
result = 0
|
|
206
|
+
for c in s:
|
|
207
|
+
if not isinstance(c, int):
|
|
208
|
+
c = ord(c)
|
|
209
|
+
result = 256 * result + c
|
|
210
|
+
return result
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def digest_integer(m):
|
|
214
|
+
"""Convert an integer into a string of bytes, compute
|
|
215
|
+
its SHA-1 hash, and convert the result to an integer."""
|
|
216
|
+
#
|
|
217
|
+
# I don't expect this function to be used much. I wrote
|
|
218
|
+
# it in order to be able to duplicate the examples
|
|
219
|
+
# in ECDSAVS.
|
|
220
|
+
#
|
|
221
|
+
from hashlib import sha1
|
|
222
|
+
return string_to_int(sha1(int_to_string(m)).digest())
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def point_is_valid(generator, x, y):
|
|
226
|
+
"""Is (x,y) a valid public key based on the specified generator?"""
|
|
227
|
+
|
|
228
|
+
# These are the tests specified in X9.62.
|
|
229
|
+
|
|
230
|
+
n = generator.order()
|
|
231
|
+
curve = generator.curve()
|
|
232
|
+
if x < 0 or n <= x or y < 0 or n <= y:
|
|
233
|
+
return False
|
|
234
|
+
if not curve.contains_point(x, y):
|
|
235
|
+
return False
|
|
236
|
+
if not n * ellipticcurve.Point(curve, x, y) == ellipticcurve.INFINITY:
|
|
237
|
+
return False
|
|
238
|
+
return True
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
# NIST Curve P-192:
|
|
242
|
+
_p = 6277101735386680763835789423207666416083908700390324961279
|
|
243
|
+
_r = 6277101735386680763835789423176059013767194773182842284081
|
|
244
|
+
# s = 0x3045ae6fc8422f64ed579528d38120eae12196d5L
|
|
245
|
+
# c = 0x3099d2bbbfcb2538542dcd5fb078b6ef5f3d6fe2c745de65L
|
|
246
|
+
_b = 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1
|
|
247
|
+
_Gx = 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012
|
|
248
|
+
_Gy = 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811
|
|
249
|
+
|
|
250
|
+
curve_192 = ellipticcurve.CurveFp(_p, -3, _b)
|
|
251
|
+
generator_192 = ellipticcurve.Point(curve_192, _Gx, _Gy, _r)
|
|
252
|
+
|
|
253
|
+
# NIST Curve P-224:
|
|
254
|
+
_p = 26959946667150639794667015087019630673557916260026308143510066298881
|
|
255
|
+
_r = 26959946667150639794667015087019625940457807714424391721682722368061
|
|
256
|
+
# s = 0xbd71344799d5c7fcdc45b59fa3b9ab8f6a948bc5L
|
|
257
|
+
# c = 0x5b056c7e11dd68f40469ee7f3c7a7d74f7d121116506d031218291fbL
|
|
258
|
+
_b = 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
|
|
259
|
+
_Gx = 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21
|
|
260
|
+
_Gy = 0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34
|
|
261
|
+
|
|
262
|
+
curve_224 = ellipticcurve.CurveFp(_p, -3, _b)
|
|
263
|
+
generator_224 = ellipticcurve.Point(curve_224, _Gx, _Gy, _r)
|
|
264
|
+
|
|
265
|
+
# NIST Curve P-256:
|
|
266
|
+
_p = 115792089210356248762697446949407573530086143415290314195533631308867097853951
|
|
267
|
+
_r = 115792089210356248762697446949407573529996955224135760342422259061068512044369
|
|
268
|
+
# s = 0xc49d360886e704936a6678e1139d26b7819f7e90L
|
|
269
|
+
# c = 0x7efba1662985be9403cb055c75d4f7e0ce8d84a9c5114abcaf3177680104fa0dL
|
|
270
|
+
_b = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
|
|
271
|
+
_Gx = 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
|
|
272
|
+
_Gy = 0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5
|
|
273
|
+
|
|
274
|
+
curve_256 = ellipticcurve.CurveFp(_p, -3, _b)
|
|
275
|
+
generator_256 = ellipticcurve.Point(curve_256, _Gx, _Gy, _r)
|
|
276
|
+
|
|
277
|
+
# NIST Curve P-384:
|
|
278
|
+
_p = 39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319
|
|
279
|
+
_r = 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643
|
|
280
|
+
# s = 0xa335926aa319a27a1d00896a6773a4827acdac73L
|
|
281
|
+
# c = 0x79d1e655f868f02fff48dcdee14151ddb80643c1406d0ca10dfe6fc52009540a495e8042ea5f744f6e184667cc722483L
|
|
282
|
+
_b = 0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef
|
|
283
|
+
_Gx = 0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7
|
|
284
|
+
_Gy = 0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f
|
|
285
|
+
|
|
286
|
+
curve_384 = ellipticcurve.CurveFp(_p, -3, _b)
|
|
287
|
+
generator_384 = ellipticcurve.Point(curve_384, _Gx, _Gy, _r)
|
|
288
|
+
|
|
289
|
+
# NIST Curve P-521:
|
|
290
|
+
_p = 6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151
|
|
291
|
+
_r = 6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449
|
|
292
|
+
# s = 0xd09e8800291cb85396cc6717393284aaa0da64baL
|
|
293
|
+
# c = 0x0b48bfa5f420a34949539d2bdfc264eeeeb077688e44fbf0ad8f6d0edb37bd6b533281000518e19f1b9ffbe0fe9ed8a3c2200b8f875e523868c70c1e5bf55bad637L
|
|
294
|
+
_b = 0x051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00
|
|
295
|
+
_Gx = 0xc6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66
|
|
296
|
+
_Gy = 0x11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650
|
|
297
|
+
|
|
298
|
+
curve_521 = ellipticcurve.CurveFp(_p, -3, _b)
|
|
299
|
+
generator_521 = ellipticcurve.Point(curve_521, _Gx, _Gy, _r)
|
|
300
|
+
|
|
301
|
+
# Certicom secp256-k1
|
|
302
|
+
_a = 0x0000000000000000000000000000000000000000000000000000000000000000
|
|
303
|
+
_b = 0x0000000000000000000000000000000000000000000000000000000000000007
|
|
304
|
+
_p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
|
|
305
|
+
_Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
|
|
306
|
+
_Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
|
|
307
|
+
_r = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
|
|
308
|
+
|
|
309
|
+
curve_secp256k1 = ellipticcurve.CurveFp(_p, _a, _b)
|
|
310
|
+
generator_secp256k1 = ellipticcurve.Point(curve_secp256k1, _Gx, _Gy, _r)
|