blob: eec83bd9f3e0925ea571c683c576291427495fff [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6296],{5680:(e,r,t)=>{t.d(r,{xA:()=>o,yg:()=>b});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,b=i["".concat(l,".").concat(u)]||i[u]||m[u]||p;return t?a.createElement(b,g(g({ref:r},o),{},{components:t})):a.createElement(b,g({ref:r},o))}));function b(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"},4046:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>o,contentTitle:()=>l,default:()=>b,frontMatter:()=>y,metadata:()=>s,toc:()=>i});var a=t(8168),n=t(8587),p=(t(6540),t(5680)),g=["components"],y={id:"bls192",title:"BLS192",sidebar_label:"BLS192"},l=void 0,s={unversionedId:"cryptojs/bls192",id:"cryptojs/bls192",title:"BLS192",description:"BLS192",source:"@site/../docs/cryptojs/bls192.md",sourceDirName:"cryptojs",slug:"/cryptojs/bls192",permalink:"/docs/cryptojs/bls192",draft:!1,tags:[],version:"current",frontMatter:{id:"bls192",title:"BLS192",sidebar_label:"BLS192"},sidebar:"docs",previous:{title:"BLS",permalink:"/docs/cryptojs/bls"},next:{title:"BLS256",permalink:"/docs/cryptojs/bls256"}},o={},i=[{value:"BLS192",id:"bls192",level:2},{value:"new BLS192()",id:"new-bls192",level:3},{value:"BLS192.bytestostring() \u21d2",id:"bls192bytestostring-",level:3},{value:"BLS192.stringtobytes() \u21d2",id:"bls192stringtobytes-",level:3},{value:"BLS192.bls_hashit() \u21d2",id:"bls192bls_hashit-",level:3},{value:"BLS192.KeyPairGenerate() \u21d2",id:"bls192keypairgenerate-",level:3},{value:"BLS192.sign() \u21d2",id:"bls192sign-",level:3},{value:"BLS192.verify() \u21d2",id:"bls192verify-",level:3},{value:"BLS192.add_G1() \u21d2",id:"bls192add_g1-",level:3},{value:"BLS192.add_G2() \u21d2",id:"bls192add_g2-",level:3}],m={toc:i},u="wrapper";function b(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:"BLS192"}),(0,p.yg)("h2",{id:"bls192"},"BLS192"),(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,'{"{"}BLS192{"}"}')," "),(0,p.yg)("ul",null,(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192"},"BLS192"),(0,p.yg)("ul",{parentName:"li"},(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#new_BLS192_new"},"new BLS192()")),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.bytestostring"},".bytestostring()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.stringtobytes"},".stringtobytes()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.bls_hashit"},".bls_hashit()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.KeyPairGenerate"},".KeyPairGenerate()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.sign"},".sign()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.verify"},".verify()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.add_G1"},".add_G1()")," \u21d2"),(0,p.yg)("li",{parentName:"ul"},(0,p.yg)("a",{parentName:"li",href:"#BLS192.add_G2"},".add_G2()")," \u21d2")))),(0,p.yg)("a",{name:"new_BLS192_new"}),(0,p.yg)("h3",{id:"new-bls192"},"new BLS192()"),(0,p.yg)("p",null,"Creates an instance of BLS192"),(0,p.yg)("a",{name:"BLS192.bytestostring"}),(0,p.yg)("h3",{id:"bls192bytestostring-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.stringtobytes"}),(0,p.yg)("h3",{id:"bls192stringtobytes-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.bls_hashit"}),(0,p.yg)("h3",{id:"bls192bls_hashit-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.KeyPairGenerate"}),(0,p.yg)("h3",{id:"bls192keypairgenerate-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.sign"}),(0,p.yg)("h3",{id:"bls192sign-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.verify"}),(0,p.yg)("h3",{id:"bls192verify-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.add_G1"}),(0,p.yg)("h3",{id:"bls192add_g1-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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:"BLS192.add_G2"}),(0,p.yg)("h3",{id:"bls192add_g2-"},"BLS192.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:"#BLS192"},(0,p.yg)("code",null,"BLS192")),(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"))}b.isMDXComponent=!0}}]);