dis2 / bls12 Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED
DEPRECATED
Currently you can in certain scenarios unmarshal an uncompressed point of the incorrect size.
One such an example on G1 is the point which marshals to (in uncompressed form):
[15 133 139 158 48 39 204 194 85 143 234 84 72 108 17 55 40 63 225 173 59 232 133 119 242 104 119 78 193 154 199 76 209 47 128 145 34 95 166 62 1 52 93 176 49 82 172 198 11 1 91 45 211 233 89 158 15 160 59 146 255 231 183 95 222 238 59 140 51 54 4 31 113 164 45 217 126 151 112 149 141 130 230 190 165 117 138 186 110 58 55 140 228 77 232 155]
If the first byte of that is removed, it will still unmarshal even though it is of the wrong size according to the specification for bls12-381 serialization. (https://github.com/ebfull/pairing/tree/master/src/bls12_381)
Could it be checked that the size of what is being unmarshalled matches the compressed or uncompressed size exactly?
When I try running a test case, I get the following error:
# github.com/dis2/bls12
/usr/bin/ld: $WORK/github.com/dis2/bls12/_obj/add.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: $WORK/github.com/dis2/bls12/_obj/mul.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: $WORK/github.com/dis2/bls12/_obj/rdc.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Go version: 1.9.1
Since the operations in this library are mutative, could a method to copy elements in each group be added?
Otherwise to copy points upstream, one has to Marshal and Unmarshal upstream to copy an element, which is unnecessarily costly.
Could you please choose an open source license so that other projects may use your code?
https://choosealicense.com/
https://opensource.org/licenses
Thanks!
/usr/bin/x86_64-linux-gnu-ld: $WORK/b058/_x011.o: relocation R_X86_64_32S against .data' can not be used when making a PIE object; recompile with -fPIC /usr/bin/x86_64-linux-gnu-ld: $WORK/b058/_x012.o: relocation R_X86_64_32S against
.data' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: $WORK/b058/_x013.o: relocation R_X86_64_32S against `.data' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Process exiting with code: 1
By the way, it's ok in MS Window.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.