Skip to content

Commit c24a6ab

Browse files
committed
Reduce the number of public APIs smaller and add more detailed documentation
1 parent 2bfc333 commit c24a6ab

15 files changed

+799
-694
lines changed

Cargo.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Srinath Setty <srinath@microsoft.com>"]
55
edition = "2018"
66

77
[dependencies]
8-
curve25519-dalek = { version = "2", features = ["serde"]}
8+
curve25519-dalek = { version = "2", features = ["serde", "simd_backend"]}
99
merlin = "2.0.0"
1010
rand = "0.7.3"
1111
digest = "0.8.1"
@@ -45,8 +45,5 @@ name = "nizk"
4545
harness = false
4646

4747
[features]
48-
simd_backend = ["curve25519-dalek/simd_backend"]
49-
rayon_par = []
50-
profile = []
51-
52-
default = ["simd_backend"]
48+
multicore = []
49+
profile = []

NOTICE.md

+69-117
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,73 @@
11
This repository includes the following third-party open-source code.
22

3-
* The code in src/scalar/ristretto255.rs is derived from [bls12-381](https://github.com/zkcrypto/bls12_381).
3+
* The code in `src/scalar/ristretto255.rs` is derived from [bls12-381](https://github.com/zkcrypto/bls12_381).
44
Specifically, from [src/bls12_381/scalar.rs](https://github.com/zkcrypto/bls12_381/blob/master/src/scalar.rs) and [src/bls12_381/util.rs](https://github.com/zkcrypto/bls12_381/blob/master/src/util.rs), which has the following copyright and license.
55

6-
Permission is hereby granted, free of charge, to any
7-
person obtaining a copy of this software and associated
8-
documentation files (the "Software"), to deal in the
9-
Software without restriction, including without
10-
limitation the rights to use, copy, modify, merge,
11-
publish, distribute, sublicense, and/or sell copies of
12-
the Software, and to permit persons to whom the Software
13-
is furnished to do so, subject to the following
14-
conditions:
15-
16-
The above copyright notice and this permission notice
17-
shall be included in all copies or substantial portions
18-
of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
21-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
22-
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23-
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
24-
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27-
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28-
DEALINGS IN THE SOFTWARE.
29-
30-
31-
* The invert and batch_invert methods in src/scalar/ristretto255.rs is from [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek), which has the following copyright and license.
32-
33-
Copyright (c) 2016-2019 Isis Agora Lovecruft, Henry de Valence. All rights reserved.
34-
35-
Redistribution and use in source and binary forms, with or without
36-
modification, are permitted provided that the following conditions are
37-
met:
38-
39-
1. Redistributions of source code must retain the above copyright
40-
notice, this list of conditions and the following disclaimer.
41-
42-
2. Redistributions in binary form must reproduce the above copyright
43-
notice, this list of conditions and the following disclaimer in the
44-
documentation and/or other materials provided with the distribution.
45-
46-
3. Neither the name of the copyright holder nor the names of its
47-
contributors may be used to endorse or promote products derived from
48-
this software without specific prior written permission.
49-
50-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
51-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
52-
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
53-
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54-
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
56-
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
57-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
58-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
59-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
60-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61-
62-
========================================================================
63-
64-
Portions of curve25519-dalek were originally derived from Adam Langley's
65-
Go ed25519 implementation, found at <https://github.com/agl/ed25519/>,
66-
under the following licence:
67-
68-
========================================================================
69-
70-
Copyright (c) 2012 The Go Authors. All rights reserved.
71-
72-
Redistribution and use in source and binary forms, with or without
73-
modification, are permitted provided that the following conditions are
74-
met:
75-
76-
* Redistributions of source code must retain the above copyright
77-
notice, this list of conditions and the following disclaimer.
78-
* Redistributions in binary form must reproduce the above
79-
copyright notice, this list of conditions and the following disclaimer
80-
in the documentation and/or other materials provided with the
81-
distribution.
82-
* Neither the name of Google Inc. nor the names of its
83-
contributors may be used to endorse or promote products derived from
84-
this software without specific prior written permission.
85-
86-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
87-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
88-
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
89-
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
90-
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
91-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
92-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
93-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
94-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
95-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
96-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97-
98-
99-
* The src/nizk/bullet.rs is derived from [bulletproofs](https://github.com/dalek-cryptography/bulletproofs/), which has the following license:
100-
101-
MIT License
102-
103-
Copyright (c) 2018 Chain, Inc.
104-
105-
Permission is hereby granted, free of charge, to any person obtaining a copy
106-
of this software and associated documentation files (the "Software"), to deal
107-
in the Software without restriction, including without limitation the rights
108-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
109-
copies of the Software, and to permit persons to whom the Software is
110-
furnished to do so, subject to the following conditions:
111-
112-
The above copyright notice and this permission notice shall be included in all
113-
copies or substantial portions of the Software.
114-
115-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
116-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
117-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
118-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
119-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
120-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
121-
SOFTWARE.
6+
Permission is hereby granted, free of charge, to any
7+
person obtaining a copy of this software and associated
8+
documentation files (the "Software"), to deal in the
9+
Software without restriction, including without
10+
limitation the rights to use, copy, modify, merge,
11+
publish, distribute, sublicense, and/or sell copies of
12+
the Software, and to permit persons to whom the Software
13+
is furnished to do so, subject to the following
14+
conditions:
15+
16+
The above copyright notice and this permission notice
17+
shall be included in all copies or substantial portions
18+
of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
21+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
22+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
24+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28+
DEALINGS IN THE SOFTWARE.
29+
30+
31+
* The `invert` and `batch_invert` methods in src/scalar/ristretto255.rs is from [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek), which has the following license.
32+
33+
Copyright (c) 2016-2019 Isis Agora Lovecruft, Henry de Valence. All rights reserved.
34+
35+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
36+
37+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
38+
39+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
40+
41+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
42+
43+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
44+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45+
46+
========================================================================
47+
48+
Portions of curve25519-dalek were originally derived from Adam Langley's Go ed25519 implementation, found at <https://github.com/agl/ed25519/>, under the following licence:
49+
50+
========================================================================
51+
52+
Copyright (c) 2012 The Go Authors. All rights reserved.
53+
54+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
55+
56+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
57+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
58+
* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
59+
60+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61+
62+
63+
* The module `src/nizk/bullet.rs` is derived from [bulletproofs](https://github.com/dalek-cryptography/bulletproofs/), which has the following license:
64+
65+
MIT License
66+
67+
Copyright (c) 2018 Chain, Inc.
68+
69+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
70+
71+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
72+
73+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)