Skip to content

Commit

Permalink
[libpy][test] refs skycoin#68 modifying the text with the new syntax …
Browse files Browse the repository at this point in the history
…59 passed in 45.16 seconds
  • Loading branch information
stdevKoky committed Sep 3, 2018
1 parent 9a617d2 commit 59c94e6
Show file tree
Hide file tree
Showing 24 changed files with 509 additions and 6,872 deletions.
4 changes: 3 additions & 1 deletion skycoin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from .skyerror import *
import cipher
import base58
import secp256k1go
import secp256k1go
import encrypt
import scrypt
63 changes: 61 additions & 2 deletions skycoin/cipher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from .libpy import *
from libpy import skycoin

def PubKey():
Expand Down Expand Up @@ -83,4 +82,64 @@ def GenerateDeterministicKeyPair(data, public_key, secret_key):
return skycoin.SKY_cipher_GenerateDeterministicKeyPair(data, public_key, secret_key)

def AddressNull(address):
return skycoin.SKY_cipher_Address_Null(address)
return skycoin.SKY_cipher_Address_Null(address)

def PubKeyVerify(public_key):
return skycoin.SKY_cipher_PubKey_Verify(public_key)

def SecKeyVerify(secret_key):
return skycoin.SKY_cipher_SecKey_Verify(secret_key)

def ECDH(public_key_2, secret_key_1):
return skycoin.SKY_cipher_ECDH(public_key_2, secret_key_1)

def Sig():
return skycoin.cipher_Sig()

def NewSig(data, sig):
return skycoin.SKY_cipher_NewSig(data, sig)

def SignHash(sha_sum, secret_key_1, sig_1):
return skycoin.SKY_cipher_SignHash(sha_sum, secret_key_1, sig_1)

def ChkSig(addres, sha_sum, sig_1):
return skycoin.SKY_cipher_ChkSig(addres, sha_sum, sig_1)

def PubKeyFromSig(sig_1, sha_sum, public_key_2):
return skycoin.SKY_cipher_PubKeyFromSig(sig_1, sha_sum, public_key_2)

def VerifySignature(public_key, sig_1, sha_sum_1):
return skycoin.SKY_cipher_VerifySignature(public_key, sig_1, sha_sum_1)

def GenerateDeterministicKeyPairsSeed(seed, num):
return skycoin.SKY_cipher_GenerateDeterministicKeyPairsSeed(seed, num)

def Ripemd160():
return skycoin.cipher_Ripemd160()

def HashRipemd160(p0, p1):
return skycoin.SKY_cipher_HashRipemd160(p0, p1)

def Ripemd160Set(h, b):
return skycoin.SKY_cipher_Ripemd160_Set(h, b)

def SHA256Set(h, b):
return skycoin.SKY_cipher_SHA256_Set(h, b)

def SHA256Hex(h):
return skycoin.SKY_cipher_SHA256_Hex(h)

def SHA256FromHex(p0, p1):
return skycoin.SKY_cipher_SHA256FromHex(p0, p1)

def DoubleSHA256(b, h):
return skycoin.SKY_cipher_DoubleSHA256(b, h)

def AddSHA256(p0, p1, p2):
return skycoin.SKY_cipher_AddSHA256(p0, p1, p2)

def SHA256Xor(p0, p1, p2):
return skycoin.SKY_cipher_SHA256_Xor(p0, p1, p2)

def SHA256Null(p0):
return skycoin.SKY_cipher_SHA256_Null(p0)
16 changes: 16 additions & 0 deletions skycoin/encrypt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from libpy import skycoin

def Sha256XorEncrypt(data, cadena):
return skycoin.SKY_encrypt_Sha256Xor_Encrypt(data, cadena)

def Sha256XorDecrypt(p0, p1):
return skycoin.SKY_encrypt_Sha256Xor_Decrypt(p0, p1)

def ScryptChacha20poly1305():
return skycoin.encrypt__ScryptChacha20poly1305()

def ScryptChacha20poly1305Encrypt(crypt, plaintext, passwd):
return skycoin.SKY_encrypt_ScryptChacha20poly1305_Encrypt(crypt, plaintext, passwd)

def ScryptChacha20poly1305Decrypt(crypt, encrypto, password):
return skycoin.SKY_encrypt_ScryptChacha20poly1305_Decrypt(crypt, encrypto, password)
4 changes: 4 additions & 0 deletions skycoin/scrypt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from libpy import skycoin

def Key(p0, p1, p2, p3, p4, p5):
return skycoin.SKY_scrypt_Key(p0, p1, p2, p3, p4, p5)
5 changes: 4 additions & 1 deletion skycoin/secp256k1go.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ def FieldNormalize(p0):
return skycoin.SKY_secp256k1go_Field_Normalize(p0)

def FieldEquals(p0, p1):
return skycoin.SKY_secp256k1go_Field_Equals(p0, p1)
return skycoin.SKY_secp256k1go_Field_Equals(p0, p1)

def FieldInv(in_, out):
return skycoin.SKY_secp256k1go_Field_Inv(in_, out)
Loading

0 comments on commit 59c94e6

Please sign in to comment.