blob: 4c90091f68433331f6b3005688ed417d7d5ba781 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4438],{5680:(e,r,t)=>{t.d(r,{xA:()=>o,yg:()=>d});var a=t(6540);function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function g(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function y(e,r){if(null==e)return{};var t,a,n=function(e,r){if(null==e)return{};var t,a,n={},p=Object.keys(e);for(a=0;a<p.length;a++)t=p[a],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(a=0;a<p.length;a++)t=p[a],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}var l=a.createContext({}),s=function(e){var r=a.useContext(l),t=r;return e&&(t="function"==typeof e?e(r):g(g({},r),e)),t},o=function(e){var r=s(e.components);return a.createElement(l.Provider,{value:r},e.children)},i="mdxType",m={inlineCode:"code",wrapper:function(e){var r=e.children;return a.createElement(a.Fragment,{},r)}},u=a.forwardRef((function(e,r){var t=e.components,n=e.mdxType,p=e.originalType,l=e.parentName,o=y(e,["components","mdxType","originalType","parentName"]),i=s(t),u=n,d=i["".concat(l,".").concat(u)]||i[u]||m[u]||p;return t?a.createElement(d,g(g({ref:r},o),{},{components:t})):a.createElement(d,g({ref:r},o))}));function d(e,r){var t=arguments,n=r&&r.mdxType;if("string"==typeof e||n){var p=t.length,g=new Array(p);g[0]=u;var y={};for(var l in r)hasOwnProperty.call(r,l)&&(y[l]=r[l]);y.originalType=e,y[i]="string"==typeof e?e:n,g[1]=y;for(var s=2;s<p;s++)g[s]=t[s];return a.createElement.apply(null,g)}return a.createElement.apply(null,t)}u.displayName="MDXCreateElement"},9999:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>o,contentTitle:()=>l,default:()=>d,frontMatter:()=>y,metadata:()=>s,toc:()=>i});var a=t(8168),n=t(8587),p=(t(6540),t(5680)),g=["components"],y={id:"bls256",title:"BLS256",sidebar_label:"BLS256"},l=void 0,s={unversionedId:"cryptojs/bls256",id:"cryptojs/bls256",title:"BLS256",description:"BLS256",source:"@site/../docs/cryptojs/bls256.md",sourceDirName:"cryptojs",slug:"/cryptojs/bls256",permalink:"/docs/cryptojs/bls256",draft:!1,tags:[],version:"current",frontMatter:{id:"bls256",title:"BLS256",sidebar_label:"BLS256"},sidebar:"docs",previous:{title:"BLS192",permalink:"/docs/cryptojs/bls192"},next:{title:"DBIG",permalink:"/docs/cryptojs/dbig"}},o={},i=[{value:"BLS256",id:"bls256",level:2},{value:"new BLS256()",id:"new-bls256",level:3},{value:"BLS256.bytestostring() \u21d2",id:"bls256bytestostring-",level:3},{value:"BLS256.stringtobytes() \u21d2",id:"bls256stringtobytes-",level:3},{value:"BLS256.bls_hashit() \u21d2",id:"bls256bls_hashit-",level:3},{value:"BLS256.KeyPairGenerate() \u21d2",id:"bls256keypairgenerate-",level:3},{value:"BLS256.sign() \u21d2",id:"bls256sign-",level:3},{value:"BLS256.verify() \u21d2",id:"bls256verify-",level:3},{value:"BLS256.add_G1() \u21d2",id:"bls256add_g1-",level:3},{value:"BLS256.add_G2() \u21d2",id:"bls256add_g2-",level:3}],m={toc:i},u="wrapper";function d(e){var r=e.components,t=(0,n.A)(e,g);return(0,p.yg)(u,(0,a.A)({},m,t,{components:r,mdxType:"MDXLayout"}),(0,p.yg)("a",{name:"BLS256"}),(0,p.yg)("h2",{id:"bls256"},"BLS256"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": global class",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS256{"}"}')," "),(0,p.yg)("ul",null,(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256"},"BLS256"),(0,p.yg)("ul",{parentName:"li"},(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#new_BLS256_new"},"new BLS256()")),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.bytestostring"},".bytestostring()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.stringtobytes"},".stringtobytes()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.bls_hashit"},".bls_hashit()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.KeyPairGenerate"},".KeyPairGenerate()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.sign"},".sign()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.verify"},".verify()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.add_G1"},".add_G1()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS256.add_G2"},".add_G2()")," \u21d2")))),(0,p.yg)("a",{name:"new_BLS256_new"}),(0,p.yg)("h3",{id:"new-bls256"},"new BLS256()"),(0,p.yg)("p",null,"Creates an instance of BLS256"),(0,p.yg)("a",{name:"BLS256.bytestostring"}),(0,p.yg)("h3",{id:"bls256bytestostring-"},"BLS256.bytestostring() \u21d2"),(0,p.yg)("p",null,"Convert byte array to string"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": string",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": b byte array "),(0,p.yg)("a",{name:"BLS256.stringtobytes"}),(0,p.yg)("h3",{id:"bls256stringtobytes-"},"BLS256.stringtobytes() \u21d2"),(0,p.yg)("p",null,"Convert string to byte array"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": byte array",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": s string "),(0,p.yg)("a",{name:"BLS256.bls_hashit"}),(0,p.yg)("h3",{id:"bls256bls_hashit-"},"BLS256.bls_hashit() \u21d2"),(0,p.yg)("p",null,"hash a message to an ECP point, using SHA3"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": ECP point",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": m message to be hashedstring "),(0,p.yg)("a",{name:"BLS256.KeyPairGenerate"}),(0,p.yg)("h3",{id:"bls256keypairgenerate-"},"BLS256.KeyPairGenerate() \u21d2"),(0,p.yg)("p",null,"Generate key pair"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": Error code",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": rng Cryptographically Secure Random Number Generator",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": S Private key",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": W Public key "),(0,p.yg)("a",{name:"BLS256.sign"}),(0,p.yg)("h3",{id:"bls256sign-"},"BLS256.sign() \u21d2"),(0,p.yg)("p",null,"Sign message"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": Error code",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": SIG Singature",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": m Message to sign",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": S Private key "),(0,p.yg)("a",{name:"BLS256.verify"}),(0,p.yg)("h3",{id:"bls256verify-"},"BLS256.verify() \u21d2"),(0,p.yg)("p",null,"Verify message"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": Error code",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": SIG Signature",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": m Message to sign",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": W Public key "),(0,p.yg)("a",{name:"BLS256.add_G1"}),(0,p.yg)("h3",{id:"bls256add_g1-"},"BLS256.add_G1() \u21d2"),(0,p.yg)("p",null,"R=R1+R2 in group G1"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": Error code",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": R1 G1 Point",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": R2 G1 Point",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": R G1 Point "),(0,p.yg)("a",{name:"BLS256.add_G2"}),(0,p.yg)("h3",{id:"bls256add_g2-"},"BLS256.add_G2() \u21d2"),(0,p.yg)("p",null,"W=W1+W2 in group G2"),(0,p.yg)("p",null,(0,p.yg)("strong",{parentName:"p"},"Kind"),": static method of ",(0,p.yg)("a",{parentName:"p",href:"#BLS256"},(0,p.yg)("code",null,"BLS256")),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Returns"),": Error code",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"this"),": ",(0,p.yg)("code",null,'{"{"}BLS192{"}"}'),(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": W1 G2 Point",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": W2 G2 Point",(0,p.yg)("br",{parentName:"p"}),"\n",(0,p.yg)("strong",{parentName:"p"},"Parameter"),": R G2 Point"))}d.isMDXComponent=!0}}]);