(function(){function n(g){var k=g.jsustoolkitErrCode=g.jsustoolkitErrCode||{},d=g.pkcs5=g.pkcs5||{},b=g.asn1,h=g.pki=g.pki||{};d.pbe={};var m={name:"PBES1Algorithms.params",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES1Algorithms.params.salt",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES1Algorithms.params.iterationCount",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,onstructed:!0,capture:"kdfIterationCount"}]},n={name:"PBES2Algorithms",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,onstructed:!0,capture:"kdfIterationCount"}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},p={name:"pkcs-12PbeParams",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"iterations"}]};d.pbkdf1=function(a,f,l,e,c){if(null==a||"undefined"==typeof a)throw{code:"111001",message:k["111001"]};if(null==f||"undefined"==typeof f)throw{code:"111002",message:k["111002"]};if(null==l||"undefined"==typeof l)throw{code:"111003",message:k["111003"]};if(null==e||"undefined"==typeof e)throw{code:"111004",message:k["111004"]};if("undefined"===typeof c||null===c)c=g.md.sha1.create();if(e>4294967295*c.digestLength)throw{code:"111005",message:k["111005"]};c.start();c.update(a);a=f;for(f=1;f<=l;++f)14294967295*b)throw{code:"111005",message:k["111005"]};var h=Math.ceil(e/b);e-=(h-1)*b;var d=g.hmac.create();d.start(c,a);a="";for(var m,n=1;n<=h;++n){d.update(f);d.update(g.util.int32ToBytes(n));c=m=d.digest().getBytes();for(var p=2;p<=l;++p)d.start(null,null),d.update(m),m=d.digest().getBytes(),c=g.util.xorBytes(c,m,b);a+=n