-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zkp #726
Add zkp #726
Conversation
Better add some UT test and samples here @doubiliu |
I think the same |
Got it. Actually,I have prepared some examples,.I put them here https://github.com/doubiliu/phase2/tree/dev |
I would say we can move forward if samples is not going to be added here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now tests doesn't pass
Unknown or unimplemented syscalls: System.Crypto.Bls12381Add
System.Crypto.Bls12381Mul
System.Crypto.Bls12381Pairing
This would need new neo core. |
YES,I need neo-core V3.6 |
@doubiliu please update this pr |
neo 3.6 will solve the issue, noting need to be done
@shargon please review |
Tested OK with this contract: public partial class TestContract : SmartContract
{
[InitialValue("0f41e58663bf08cf068672cbd01a7ec73baca4d72ca93544deff686bfd6df543d48eaa24afe47e1efde449383b67663104c581234d086a9902249b64728ffd21a189e87935a954051c7cdba7b3872629a4fafc05066245cb9108f0242d0fe3ef03350f55a7aefcd3c31b4fcb6ce5771cc6a0e9786ab5973320c806ad360829107ba810c5a09ffdd9be2291a0c25a99a211b8b424cd48bf38fcef68083b0b0ec5c81a93b330ee1a677d0d15ff7b984e8978ef48881e32fac91b93b47333e2ba5706fba23eb7c5af0d9f80940ca771b6ffd5857baaf222eb95a7d2809d61bfe02e1bfd1b68ff02f0b8102ae1c2d5d5ab1a19f26337d205fb469cd6bd15c3d5a04dc88784fbb3d0b2dbdea54d43b2b73f2cbb12d58386a8703e0f948226e47ee89d018107154f25a764bd3c79937a45b84546da634b8f6be14a8061e55cceba478b23f7dacaa35c8ca78beae9624045b4b601b2f522473d171391125ba84dc4007cfbf2f8da752f7c74185203fcca589ac719c34dffbbaad8431dad1c1fb597aaa5193502b86edb8857c273fa075a50512937e0794e1e65a7617c90d8bd66065b1fffe51d7a579973b1315021ec3c19934f1368bb445c7c2d209703f239689ce34c0378a68e72a6b3b216da0e22a5031b54ddff57309396b38c881c4c849ec23e87089a1c5b46e5110b86750ec6a532348868a84045483c92b7af5af689452eafabf1a8943e50439f1d59882a98eaa0170f1250ebd871fc0a92a7b2d83168d0d727272d441befa15c503dd8e90ce98db3e7b6d194f60839c508a84305aaca1789b6", ContractParameterType.ByteArray)]
private static readonly byte[] testScript;
[InitialValue("97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb", ContractParameterType.ByteArray)]
private static readonly byte[] g1;
[InitialValue("93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8", ContractParameterType.ByteArray)]
private static readonly byte[] g2;
public static object TestBlsAdd()
{
return CryptoLib.Bls12381Add(CryptoLib.Bls12381Deserialize(testScript), CryptoLib.Bls12381Deserialize(testScript));
}
public static object TestBlsMul()
{
var data = new byte[32];
data[0] = 0x03;
return CryptoLib.Bls12381Mul(CryptoLib.Bls12381Deserialize(testScript), data, false);
}
public static object TestBlsMul1()
{
var data = new byte[32];
data[0] = 0x03;
return CryptoLib.Bls12381Mul(CryptoLib.Bls12381Deserialize(testScript), data, true);
}
public static object TestBlsPairing()
{
return CryptoLib.Bls12381Pairing(CryptoLib.Bls12381Deserialize(g1), CryptoLib.Bls12381Deserialize(g2));
}
public static object TestBlsEqual()
{
return CryptoLib.Bls12381Equal(CryptoLib.Bls12381Deserialize(testScript), CryptoLib.Bls12381Deserialize(testScript));
}
} |
Close #2647