Skip to content

Add zkp#726

Merged
shargon merged 18 commits intoneo-project:masterfrom
doubiliu:Add-zkp
Sep 6, 2023
Merged

Add zkp#726
shargon merged 18 commits intoneo-project:masterfrom
doubiliu:Add-zkp

Conversation

@doubiliu
Copy link
Contributor

Close #2647

@vncoelho vncoelho marked this pull request as ready for review February 6, 2023 20:29
@Jim8y
Copy link
Contributor

Jim8y commented Feb 8, 2023

Better add some UT test and samples here @doubiliu

@mialbu mialbu mentioned this pull request Feb 9, 2023
12 tasks
@shargon
Copy link
Member

shargon commented Feb 10, 2023

Better add some UT test and samples here @doubiliu

I think the same

@doubiliu
Copy link
Contributor Author

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
We can add new samples together, or make it into a tool library.

@Jim8y
Copy link
Contributor

Jim8y commented Mar 3, 2023

I would say we can move forward if samples is not going to be added here.

Jim8y
Jim8y previously approved these changes Mar 3, 2023
shargon
shargon previously requested changes Mar 5, 2023
Copy link
Member

@shargon shargon left a 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

@Jim8y
Copy link
Contributor

Jim8y commented Mar 5, 2023

Now tests doesn't pass

Unknown or unimplemented syscalls: System.Crypto.Bls12381Add System.Crypto.Bls12381Mul System.Crypto.Bls12381Pairing

This would need new neo core.

@doubiliu
Copy link
Contributor Author

doubiliu commented Mar 6, 2023

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

@Jim8y
Copy link
Contributor

Jim8y commented Jul 5, 2023

@doubiliu please update this pr

@Jim8y Jim8y dismissed shargon’s stale review September 4, 2023 09:27

neo 3.6 will solve the issue, noting need to be done

Jim8y
Jim8y previously approved these changes Sep 6, 2023
@Jim8y
Copy link
Contributor

Jim8y commented Sep 6, 2023

@shargon please review

@shargon shargon merged commit dbdb28f into neo-project:master Sep 6, 2023
@ProDog
Copy link
Contributor

ProDog commented Sep 7, 2023

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));
        }
    }

Jim8y pushed a commit that referenced this pull request Aug 3, 2025
* init
* change data type
* change return type
* change type
* add zkp
* add UT
* Fix bug
* Clean lines
---------
Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Jimmy <jinghui@wayne.edu>
Co-authored-by: doubiliu <lmy0930@126.com>
Jim8y pushed a commit that referenced this pull request Aug 18, 2025
* init

* change data type

* change return type

* change type

* add zkp

* add UT

* Fix bug

* Clean lines

---------

Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Jimmy <jinghui@wayne.edu>
Co-authored-by: doubiliu <lmy0930@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants