Permalink
Browse files

Update license and README to account for merging of our pairing preco…

…mputation code in ate-pairing upstream.
  • Loading branch information...
madars committed Jul 17, 2014
1 parent 7bf95fe commit d2238de313be3cecf35da2168b1ee1bccf54b8ad
Showing with 7 additions and 156 deletions.
  1. +0 −42 LICENSE
  2. +0 −3 README.md
  3. +6 −64 src/algebra/curves/bn128/bn128_pairing.cpp
  4. +1 −47 src/algebra/curves/bn128/bn128_pairing.hpp
View
42 LICENSE
@@ -22,45 +22,3 @@ All files, with the exceptions below, are released under the MIT License:
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.
********************************************************************************
EXCEPTIONS:
The following file includes code portions from the ate-pairing library
<https://github.com/herumi/ate-pairing> by MITSUNARI Shigeo and TERUYA Tadanori:
- src/algebra/curves/bn128/bn128_pairing.cpp
They are therefore licensed under the same license as ate-pairing, namely
"modified new BSD License <http://opensource.org/licenses/BSD-3-Clause>".
That referenced web page specifies the following license:
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
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.
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.
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 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.
View
@@ -116,9 +116,6 @@ options:
run `sudo setsebool -P allow_execheap 1` to allow execution,
or use `make CURVE=ALT_BN128` instead.
* The \[ate-pairing] code is licensed under a "modified new BSD
License", as opposed to libsnark's MIT license.
* "alt_bn128":
an alternative to "bn128", somewhat slower but avoids dynamic code generation.
@@ -2,58 +2,12 @@
********************************************************************************
Implements functions for computing Ate pairings over the bn128 curves, split into a
offline and online stages.
This code is based on the ate-pairing pairing code (https://github.com/herumi/ate-pairing),
split into offline and online stages.
********************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* Uses portions of ate-pairing <https://github.com/herumi/ate-pairing> by
* MITSUNARI Shigeo and TERUYA Tadanori
* @copyright modified new BSD License (http://opensource.org/licenses/BSD-3-Clause)
* (see LICENSE file)
* @copyright MIT license (see LICENSE file)
*******************************************************************************/
/*
The "bn128" curve choice included in libsnark is based on the ate-pairing library by
MITSUNARI Shigeo and TERUYA Tadanori [https://github.com/herumi/ate-pairing].
The ate-pairing library is licensed under "modified new BSD License"
[http://opensource.org/licenses/BSD-3-Clause].
While the ate-pairing library does not include explicit license text, the license
template at the link above is:
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
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.
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.
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
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.
*/
#include "algebra/curves/bn128/bn128_pairing.hpp"
#include "common/profiling.hpp"
#include "algebra/curves/bn128/bn128_init.hpp"
@@ -195,18 +149,6 @@ std::istream& operator>>(std::istream &in, bn128_ate_G2_precomp &prec_Q)
return in;
}
void doubling_step_for_flipped_miller_loop(Fp2 *current, bn128_ate_ell_coeffs &l)
{
Fp6::pointDblLineEvalWithoutP(l, current);
}
void mixed_addition_step_for_flipped_miller_loop(const Fp2* Q,
Fp2 *R,
bn128_ate_ell_coeffs &l)
{
Fp6::pointAddLineEvalWithoutP(l, R, Q);
}
bn128_ate_G1_precomp bn128_ate_precompute_G1(const bn128_G1& P)
{
enter_block("Call to bn128_ate_precompute_G1");
@@ -223,7 +165,7 @@ bn128_ate_G2_precomp bn128_ate_precompute_G2(const bn128_G2& Q)
enter_block("Call to bn128_ate_precompute_G2");
bn128_ate_G2_precomp result;
bn::experimental::precomputeG2(result.coeffs, result.Q, Q.coord);
bn::experimental::precomputeG2(result.coeffs, result.Q, Q.coord);
leave_block("Call to bn128_ate_precompute_G2");
return result;
@@ -233,8 +175,8 @@ bn128_Fq12 bn128_ate_miller_loop(const bn128_ate_G1_precomp &prec_P,
const bn128_ate_G2_precomp &prec_Q)
{
bn128_Fq12 f;
bn::experimental::millerLoop(f.elem, prec_Q.coeffs, prec_P.P);
return f;
bn::experimental::millerLoop(f.elem, prec_Q.coeffs, prec_P.P);
return f;
}
bn128_Fq12 bn128_double_ate_miller_loop(const bn128_ate_G1_precomp &prec_P1,
@@ -243,8 +185,8 @@ bn128_Fq12 bn128_double_ate_miller_loop(const bn128_ate_G1_precomp &prec_P1,
const bn128_ate_G2_precomp &prec_Q2)
{
bn128_Fq12 f;
bn::experimental::millerLoop2(f.elem, prec_Q1.coeffs, prec_P1.P, prec_Q2.coeffs, prec_P2.P);
return f;
bn::experimental::millerLoop2(f.elem, prec_Q1.coeffs, prec_P1.P, prec_Q2.coeffs, prec_P2.P);
return f;
}
bn128_GT bn128_final_exponentiation(const bn128_Fq12 &elt)
@@ -2,58 +2,12 @@
********************************************************************************
Declares functions for computing Ate pairings over the bn128 curves, split into a
offline and online stages.
This code is based on the ate-pairing pairing code <https://github.com/herumi/ate-pairing>,
split into offline and online stages.
********************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* Uses portions of ate-pairing <https://github.com/herumi/ate-pairing> by
* MITSUNARI Shigeo and TERUYA Tadanori
* @copyright modified new BSD License (http://opensource.org/licenses/BSD-3-Clause)
* (see LICENSE file)
* @copyright MIT license (see LICENSE file)
*******************************************************************************/
/*
The "bn128" curve choice included in libsnark is based on the ate-pairing library by
MITSUNARI Shigeo and TERUYA Tadanori [https://github.com/herumi/ate-pairing].
The ate-pairing library is licensed under "modified new BSD License"
[http://opensource.org/licenses/BSD-3-Clause].
While the ate-pairing library does not include explicit license text, the license
template at the link above is:
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
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.
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.
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
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.
*/
#ifndef BN128_PAIRING_HPP_
#define BN128_PAIRING_HPP_
#include "algebra/curves/bn128/bn128_g1.hpp"

0 comments on commit d2238de

Please sign in to comment.