File size: 58,944 Bytes
92abcd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
dataset_index,text,true_label,predicted_label,correct,error_type,probability_encryption_key_operations,probability_unrelated
0,"@Override protected byte[] doDecoding(final byte[] bytes) throws DecoderException { if (bytes == null) { return null; } try { return Base64.builder() .setLineLength(0) .setLineSeparator(BaseNCodec.getChunkSeparator()) .setUrlSafe(false) .setDecodingPolicy(decodingPolicy) .get() .decode(bytes); } catch (final IllegalArgumentException e) { throw new DecoderException(e.getMessage(), e); } }",unrelated,unrelated,True,,0.029805125668644905,0.970194935798645
1,"try { cipher = Cipher.getInstance(""DESede/CBC/NoPadding""); DESedeKeySpec keyspec = new DESedeKeySpec(key); SecretKeyFactory keyfactory = SecretKeyFactory.getInstance(""DESede""); SecretKey _key = keyfactory.generateSecret(keyspec); cipher.init( (mode == com.jcraft.jsch.Cipher.ENCRYPT_MODE ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE), _key, new IvParameterSpec(iv)); } catch (Exception e) { cipher = null; throw e; }",encryption_key_operations,encryption_key_operations,True,,0.7127633094787598,0.28723669052124023
2,"public TripleDESCBC() { super(8, 24, ""DESede"", ""DESede/CBC/NoPadding""); }",encryption_key_operations,unrelated,False,true_encryption_key_operations_predicted_unrelated,0.020394926890730858,0.9796050786972046
3,"case CRAM_MD5: { final byte[] serverChallenge = Base64.getDecoder().decode(getReplyString().substring(2).trim()); final Mac hmacMd5 = Mac.getInstance(MAC_ALGORITHM); hmacMd5.init(new SecretKeySpec(password.getBytes(getCharset()), MAC_ALGORITHM)); final byte[] hmacResult = convertToHexString(hmacMd5.doFinal(serverChallenge)).getBytes(getCharset());",encryption_key_operations,encryption_key_operations,True,,0.7052238583564758,0.29477617144584656
4,"public byte[] parseADATReply(final String reply) { if (reply == null) { return null; } return Base64.getDecoder().decode(extractPrefixedData(""ADAT="", reply)); }",unrelated,unrelated,True,,0.031772300601005554,0.968227744102478
5,"putRSACipherImplClass(""RSA/ECB/NoPadding"", ""OpenSSLCipherRSA$Raw""); put(""Alg.Alias.Cipher.RSA/None/NoPadding"", ""RSA/ECB/NoPadding""); putRSACipherImplClass(""RSA/ECB/PKCS1Padding"", ""OpenSSLCipherRSA$PKCS1""); put(""Alg.Alias.Cipher.RSA/None/PKCS1Padding"", ""RSA/ECB/PKCS1Padding""); putRSACipherImplClass(""RSA/ECB/OAEPPadding"", ""OpenSSLCipherRSA$OAEP$SHA1""); put(""Alg.Alias.Cipher.RSA/None/OAEPPadding"", ""RSA/ECB/OAEPPadding""); putRSACipherImplClass(""RSA/ECB/OAEPWithSHA-1AndMGF1Padding"", ""OpenSSLCipherRSA$OAEP$SHA1""); put(""Alg.Alias.Cipher.RSA/None/OAEPWithSHA-1AndMGF1Padding"", ""RSA/ECB/OAEPWithSHA-1AndMGF1Padding""); putRSACipherImplClass(""RSA/ECB/OAEPWithSHA-224AndMGF1Padding"", ""OpenSSLCipherRSA$OAEP$SHA224"");",encryption_key_operations,encryption_key_operations,True,,0.6398669481277466,0.3601330518722534
6,"if (buf[i] == 'A' && i + 7 < len && buf[i + 1] == 'E' && buf[i + 2] == 'S' && buf[i + 3] == '-' && buf[i + 4] == '2' && buf[i + 5] == '5' && buf[i + 6] == '6' && buf[i + 7] == '-') { i += 8; if (Session.checkCipher(JSch.getConfig(""aes256-cbc""))) { Class<? extends Cipher> c = Class.forName(JSch.getConfig(""aes256-cbc"")).asSubclass(Cipher.class); cipher = c.getDeclaredConstructor().newInstance(); iv = new byte[cipher.getIVSize()]; } else { throw new JSchException(""privatekey: aes256-cbc is not available""); } continue;",encryption_key_operations,encryption_key_operations,True,,0.6569830775260925,0.34301698207855225
7,"if (name == null) { throw new JSchException(""unsupported cipher function oid: "" + Util.toHex(id)); } if (!encryptparams.isOCTETSTRING()) { throw new ASN1Exception(); } ivp[0] = encryptparams.getContent(); try { Class<? extends Cipher> c = Class.forName(JSch.getConfig(name)).asSubclass(Cipher.class); return c.getDeclaredConstructor().newInstance(); } catch (LinkageError | Exception e) { throw new JSchException(name + "" is not supported"", e); }",encryption_key_operations,encryption_key_operations,True,,0.664061963558197,0.335938036441803
8,"@Override protected boolean doAuthenticate(Request request, HttpServletResponse response) throws IOException { if (checkForCachedAuthentication(request, response, false)) { return true; } MessageBytes authorization = request.getCoyoteRequest().getMimeHeaders().getValue(""authorization""); if (authorization == null) { if (log.isDebugEnabled()) { log.debug(sm.getString(""authenticator.noAuthHeader"")); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } authorization.toBytes(); ByteChunk authorizationBC = authorization.getByteChunk(); if (!authorizationBC.startsWithIgnoreCase(""negotiate "", 0)) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.authHeaderNotNego"")); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } authorizationBC.setStart(authorizationBC.getStart() + 10); byte[] encoded = new byte[authorizationBC.getLength()]; System.arraycopy(authorizationBC.getBuffer(), authorizationBC.getStart(), encoded, 0, authorizationBC.getLength()); byte[] decoded; try { decoded = Base64.getDecoder().decode(encoded); } catch (IllegalArgumentException e) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.authHeaderInvalidToken"")); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } if (decoded.length == 0) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.authHeaderNoToken"")); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } LoginContext lc = null; GSSContext gssContext = null; byte[] outToken; Principal principal; try { try { lc = new LoginContext(getLoginConfigName()); lc.login(); } catch (LoginException e) { log.error(sm.getString(""spnegoAuthenticator.serviceLoginFail""), e); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return false; } Subject subject = lc.getSubject(); final GSSManager manager = GSSManager.getInstance(); final int credentialLifetime; if (JreVendor.IS_IBM_JVM) { credentialLifetime = GSSCredential.INDEFINITE_LIFETIME; } else { credentialLifetime = GSSCredential.DEFAULT_LIFETIME; } gssContext = manager.createContext(Subject.callAs(subject, () -> manager.createCredential(null, credentialLifetime, new Oid(""1.3.6.1.5.5.2""), GSSCredential.ACCEPT_ONLY))); final GSSContext gssContextFinal = gssContext; outToken = Subject.callAs(subject, () -> gssContextFinal.acceptSecContext(decoded, 0, decoded.length)); if (outToken == null) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.ticketValidateFail"")); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } principal = Subject.callAs(subject, () -> context.getRealm().authenticate(gssContextFinal, storeDelegatedCredential)); } catch (GSSException e) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.ticketValidateFail""), e); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } catch (CompletionException e) { Throwable cause = e.getCause(); if (cause instanceof GSSException) { if (log.isDebugEnabled()) { log.debug(sm.getString(""spnegoAuthenticator.serviceLoginFail""), e); } } else { log.error(sm.getString(""spnegoAuthenticator.serviceLoginFail""), e); } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; } finally { if (gssContext != null) { try { gssContext.dispose(); } catch (GSSException e) { } } if (lc != null) { try { lc.logout(); } catch (LoginException e) { } } } response.setHeader(AUTH_HEADER_NAME, AUTH_HEADER_VALUE_NEGOTIATE + "" "" + Base64.getEncoder().encodeToString(outToken)); if (principal != null) { register(request, response, principal, Constants.SPNEGO_METHOD, principal.getName(), null); Pattern p = noKeepAliveUserAgents; if (p != null) { MessageBytes ua = request.getCoyoteRequest().getMimeHeaders().getValue(""user-agent""); if (ua != null && p.matcher(ua.toString()).matches()) { response.setHeader(""Connection"", ""close""); } } return true; } response.sendError(HttpServletResponse.SC_UNAUTHORIZED); return false; }",unrelated,unrelated,True,,0.4181085526943207,0.5818914771080017
9,public static byte[] decode(byte[] source) throws Base64DecodingException { try { return Base64.getDecoder().decode(source); } catch (IllegalArgumentException err) { throw new Base64DecodingException(err); } },unrelated,unrelated,True,,0.05996794253587723,0.9400320053100586
10,"public static Factory TripleDESCTR() { return new Factory(8, 192, ""3des-ctr"", ""DESede"", COUNTER_MODE); }",unrelated,unrelated,True,,0.045785918831825256,0.9542140960693359
11,"if (keySpec instanceof SecretKeySpec) { SecretKeySpec key = (SecretKeySpec) keySpec; try { if (!DESedeKeySpec.isParityAdjusted(key.getEncoded(), 0)) { throw new InvalidKeySpecException( ""SecretKeySpec is not a parity-adjusted DESEDE key""); } } catch (InvalidKeyException e) { throw new InvalidKeySpecException(e); } return key; } else if (keySpec instanceof DESedeKeySpec) { DESedeKeySpec desKeySpec = (DESedeKeySpec) keySpec; return new SecretKeySpec(desKeySpec.getKey(), ""DESEDE"");",encryption_key_operations,encryption_key_operations,True,,0.6966449618339539,0.30335500836372375
12,protected GZIPOutputStream compressionStream = null;,unrelated,unrelated,True,,0.14628231525421143,0.8537176847457886
13,"private static final String TRIPLE_DES = ""3DES"";",unrelated,unrelated,True,,0.023712940514087677,0.9762870669364929
14,"if (aClass == SecretKeySpec.class) { try { if (!DESedeKeySpec.isParityAdjusted(secretKey.getEncoded(), 0)) { throw new InvalidKeySpecException( ""SecretKey is not a parity-adjusted DESEDE key""); } } catch (InvalidKeyException e) { throw new InvalidKeySpecException(e); } if (secretKey instanceof SecretKeySpec) { return (KeySpec) secretKey; } else { return new SecretKeySpec(secretKey.getEncoded(), ""DESEDE""); } } else if (aClass == DESedeKeySpec.class) { try { return new DESedeKeySpec(secretKey.getEncoded());",encryption_key_operations,encryption_key_operations,True,,0.6956012845039368,0.30439868569374084
15,"private static SecretKey generateSymmetricKey() throws Exception { KeyGenerator keyGenerator = KeyGenerator.getInstance(""AES""); keyGenerator.init(128); return keyGenerator.generateKey(); }",encryption_key_operations,encryption_key_operations,True,,0.7078025341033936,0.29219743609428406
16,"this.mode = ((mode == com.jcraft.jsch.Cipher.ENCRYPT_MODE) ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE); this.iv = ByteBuffer.wrap(iv); this.initcounter = this.iv.getLong(4); try { keyspec = new SecretKeySpec(key, ""AES""); cipher = Cipher.getInstance(""AES/GCM/NoPadding""); cipher.init(this.mode, keyspec, new GCMParameterSpec(tagsize * 8, iv)); } catch (Exception e) { cipher = null; keyspec = null; this.iv = null; throw e; }",encryption_key_operations,encryption_key_operations,True,,0.7034414410591125,0.2965586185455322
17,"public AES256CTR() { super(16, 32, ""AES"", ""AES/CTR/NoPadding""); }",encryption_key_operations,unrelated,False,true_encryption_key_operations_predicted_unrelated,0.04207650572061539,0.9579235315322876
18,"public AES192CTR() { super(16, 24, ""AES"", ""AES/CTR/NoPadding""); }",encryption_key_operations,unrelated,False,true_encryption_key_operations_predicted_unrelated,0.03068476915359497,0.969315230846405
19,"@Override public void doFinal(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception { cipher.doFinal(foo, s1, len, bar, s2); long newcounter = iv.getLong(4) + 1; if (newcounter == initcounter) { throw new IllegalStateException(""GCM IV would be reused""); } iv.putLong(4, newcounter); cipher.init(mode, keyspec, new GCMParameterSpec(tagsize * 8, iv.array())); }",encryption_key_operations,encryption_key_operations,True,,0.6007159948348999,0.3992840647697449
20,"} else if (""GCM"".equals(algorithmMode) && ""NOPADDING"".equals(algorithmPadding)) { return new GCMEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName, replayWindowTime, replayWindowMessageCount); } try { return new BaseEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName, replayWindowTime, replayWindowMessageCount);",encryption_key_operations,encryption_key_operations,True,,0.6963741779327393,0.30362582206726074
21,"byte[] decryptedKey = hsm.unwrapKey(encryptedKey.getEncryptionMethod().getAlgorithm(), encryptedBytes); SecretKey encryptionKey = new SecretKeySpec(decryptedKey, 0, decryptedKey.length, ""AES""); xmlCipher.init(XMLCipher.DECRYPT_MODE, encryptionKey); xmlCipher.setKEK(encryptionKey); xmlCipher.doFinal(encryptedDataElement.getOwnerDocument(), encryptedDataElement, false);",encryption_key_operations,encryption_key_operations,True,,0.7060335874557495,0.2939664423465729
22,"@SuppressWarnings(""unused"") static AlgorithmParameterSpec toGCMParameterSpec(int tagLenInBits, byte[] iv) { return new GCMParameterSpec(tagLenInBits, iv); }",encryption_key_operations,unrelated,False,true_encryption_key_operations_predicted_unrelated,0.1258268505334854,0.874173104763031
23,"try { SecretKeySpec keyspec = new SecretKeySpec(key, ""AES""); cipher = Cipher.getInstance(""AES/CTR/NoPadding""); cipher.init( (mode == com.jcraft.jsch.Cipher.ENCRYPT_MODE ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE), keyspec, new IvParameterSpec(iv)); } catch (Exception e) { cipher = null; throw e; } }",encryption_key_operations,encryption_key_operations,True,,0.7089488506317139,0.2910511791706085
24,"private static final String DEFAULT_ENCRYPTION_ALGORITHM = ""AES/GCM/NoPadding"";",unrelated,unrelated,True,,0.024386009201407433,0.9756139516830444
25,"public static Factory BlowfishCBC() { return new Factory(8, 128, ""blowfish-cbc"", ""Blowfish"", CIPHER_BLOCK_CHAINING_MODE); }",unrelated,unrelated,True,,0.4239507019519806,0.576049268245697
26,"static { config.put(""kex"", Util.getSystemProperty(""jsch.kex"", ""mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256"")); config.put(""server_host_key"", Util.getSystemProperty(""jsch.server_host_key"", ""ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256"")); config.put(""ca_signature_algorithms"", Util.getSystemProperty(""jsch.ca_signature_algorithms"", ""ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256"")); config.put(""prefer_known_host_key_types"", Util.getSystemProperty(""jsch.prefer_known_host_key_types"", ""yes"")); config.put(""enable_strict_kex"", Util.getSystemProperty(""jsch.enable_strict_kex"", ""yes"")); config.put(""require_strict_kex"", Util.getSystemProperty(""jsch.require_strict_kex"", ""no"")); config.put(""enable_server_sig_algs"", Util.getSystemProperty(""jsch.enable_server_sig_algs"", ""yes"")); config.put(""enable_ext_info_in_auth"", Util.getSystemProperty(""jsch.enable_ext_info_in_auth"", ""yes"")); config.put(""cipher.s2c"", Util.getSystemProperty(""jsch.cipher"", ""aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr"")); config.put(""cipher.c2s"", Util.getSystemProperty(""jsch.cipher"", ""aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr"")); config.put(""mac.s2c"", Util.getSystemProperty(""jsch.mac"", ""hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1"")); config.put(""mac.c2s"", Util.getSystemProperty(""jsch.mac"", ""hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1"")); config.put(""compression.s2c"", Util.getSystemProperty(""jsch.compression"", ""none"")); config.put(""compression.c2s"", Util.getSystemProperty(""jsch.compression"", ""none"")); config.put(""lang.s2c"", Util.getSystemProperty(""jsch.lang"", """")); config.put(""lang.c2s"", Util.getSystemProperty(""jsch.lang"", """")); config.put(""dhgex_min"", Util.getSystemProperty(""jsch.dhgex_min"", ""2048"")); config.put(""dhgex_max"", Util.getSystemProperty(""jsch.dhgex_max"", ""8192"")); config.put(""dhgex_preferred"", Util.getSystemProperty(""jsch.dhgex_preferred"", ""3072"")); config.put(""compression_level"", Util.getSystemProperty(""jsch.compression_level"", ""6"")); config.put(""diffie-hellman-group-exchange-sha1"", ""com.jcraft.jsch.DHGEX1""); config.put(""diffie-hellman-group1-sha1"", ""com.jcraft.jsch.DHG1""); config.put(""diffie-hellman-group14-sha1"", ""com.jcraft.jsch.DHG14""); config.put(""diffie-hellman-group-exchange-sha256"", ""com.jcraft.jsch.DHGEX256""); config.put(""diffie-hellman-group-exchange-sha224@ssh.com"", ""com.jcraft.jsch.DHGEX224""); config.put(""diffie-hellman-group-exchange-sha384@ssh.com"", ""com.jcraft.jsch.DHGEX384""); config.put(""diffie-hellman-group-exchange-sha512@ssh.com"", ""com.jcraft.jsch.DHGEX512""); config.put(""diffie-hellman-group14-sha256"", ""com.jcraft.jsch.DHG14256""); config.put(""diffie-hellman-group15-sha512"", ""com.jcraft.jsch.DHG15""); config.put(""diffie-hellman-group16-sha512"", ""com.jcraft.jsch.DHG16""); config.put(""diffie-hellman-group17-sha512"", ""com.jcraft.jsch.DHG17""); config.put(""diffie-hellman-group18-sha512"", ""com.jcraft.jsch.DHG18""); config.put(""diffie-hellman-group14-sha256@ssh.com"", ""com.jcraft.jsch.DHG14256""); config.put(""diffie-hellman-group14-sha224@ssh.com"", ""com.jcraft.jsch.DHG14224""); config.put(""diffie-hellman-group15-sha256@ssh.com"", ""com.jcraft.jsch.DHG15256""); config.put(""diffie-hellman-group15-sha384@ssh.com"", ""com.jcraft.jsch.DHG15384""); config.put(""diffie-hellman-group16-sha512@ssh.com"", ""com.jcraft.jsch.DHG16""); config.put(""diffie-hellman-group16-sha384@ssh.com"", ""com.jcraft.jsch.DHG16384""); config.put(""diffie-hellman-group18-sha512@ssh.com"", ""com.jcraft.jsch.DHG18""); config.put(""ecdsa-sha2-nistp256"", ""com.jcraft.jsch.jce.SignatureECDSA256""); config.put(""ecdsa-sha2-nistp384"", ""com.jcraft.jsch.jce.SignatureECDSA384""); config.put(""ecdsa-sha2-nistp521"", ""com.jcraft.jsch.jce.SignatureECDSA521""); config.put(""ecdh-sha2-nistp256"", ""com.jcraft.jsch.DHEC256""); config.put(""ecdh-sha2-nistp384"", ""com.jcraft.jsch.DHEC384""); config.put(""ecdh-sha2-nistp521"", ""com.jcraft.jsch.DHEC521""); config.put(""ecdh-sha2-nistp"", ""com.jcraft.jsch.jce.ECDHN""); config.put(""curve25519-sha256"", ""com.jcraft.jsch.DH25519""); config.put(""curve25519-sha256@libssh.org"", ""com.jcraft.jsch.DH25519""); config.put(""curve448-sha512"", ""com.jcraft.jsch.DH448""); config.put(""mlkem768x25519-sha256"", ""com.jcraft.jsch.DH25519MLKEM768""); config.put(""mlkem768nistp256-sha256"", ""com.jcraft.jsch.DHEC256MLKEM768""); config.put(""mlkem1024nistp384-sha384"", ""com.jcraft.jsch.DHEC384MLKEM1024""); config.put(""sntrup761x25519-sha512"", ""com.jcraft.jsch.DH25519SNTRUP761""); config.put(""sntrup761x25519-sha512@openssh.com"", ""com.jcraft.jsch.DH25519SNTRUP761""); if (JavaVersion.getVersion() >= 24) { config.put(""mlkem768"", ""com.jcraft.jsch.jce.MLKEM768""); config.put(""mlkem1024"", ""com.jcraft.jsch.jce.MLKEM1024""); } else { config.put(""mlkem768"", ""com.jcraft.jsch.bc.MLKEM768""); config.put(""mlkem1024"", ""com.jcraft.jsch.bc.MLKEM1024""); } config.put(""sntrup761"", ""com.jcraft.jsch.bc.SNTRUP761""); config.put(""dh"", ""com.jcraft.jsch.jce.DH""); config.put(""3des-cbc"", ""com.jcraft.jsch.jce.TripleDESCBC""); config.put(""blowfish-cbc"", ""com.jcraft.jsch.jce.BlowfishCBC""); config.put(""hmac-sha1"", ""com.jcraft.jsch.jce.HMACSHA1""); config.put(""hmac-sha1-96"", ""com.jcraft.jsch.jce.HMACSHA196""); config.put(""hmac-sha2-256"", ""com.jcraft.jsch.jce.HMACSHA256""); config.put(""hmac-sha2-512"", ""com.jcraft.jsch.jce.HMACSHA512""); config.put(""hmac-md5"", ""com.jcraft.jsch.jce.HMACMD5""); config.put(""hmac-md5-96"", ""com.jcraft.jsch.jce.HMACMD596""); config.put(""hmac-sha1-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACSHA1ETM""); config.put(""hmac-sha1-96-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACSHA196ETM""); config.put(""hmac-sha2-256-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACSHA256ETM""); config.put(""hmac-sha2-512-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACSHA512ETM""); config.put(""hmac-md5-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACMD5ETM""); config.put(""hmac-md5-96-etm@openssh.com"", ""com.jcraft.jsch.jce.HMACMD596ETM""); config.put(""hmac-sha256-2@ssh.com"", ""com.jcraft.jsch.jce.HMACSHA2562SSHCOM""); config.put(""hmac-sha224@ssh.com"", ""com.jcraft.jsch.jce.HMACSHA224SSHCOM""); config.put(""hmac-sha256@ssh.com"", ""com.jcraft.jsch.jce.HMACSHA256SSHCOM""); config.put(""hmac-sha384@ssh.com"", ""com.jcraft.jsch.jce.HMACSHA384SSHCOM""); config.put(""hmac-sha512@ssh.com"", ""com.jcraft.jsch.jce.HMACSHA512SSHCOM""); config.put(""sha-1"", ""com.jcraft.jsch.jce.SHA1""); config.put(""sha-224"", ""com.jcraft.jsch.jce.SHA224""); config.put(""sha-256"", ""com.jcraft.jsch.jce.SHA256""); config.put(""sha-384"", ""com.jcraft.jsch.jce.SHA384""); config.put(""sha-512"", ""com.jcraft.jsch.jce.SHA512""); config.put(""md5"", ""com.jcraft.jsch.jce.MD5""); config.put(""sha1"", ""com.jcraft.jsch.jce.SHA1""); config.put(""sha224"", ""com.jcraft.jsch.jce.SHA224""); config.put(""sha256"", ""com.jcraft.jsch.jce.SHA256""); config.put(""sha384"", ""com.jcraft.jsch.jce.SHA384""); config.put(""sha512"", ""com.jcraft.jsch.jce.SHA512""); config.put(""signature.dss"", ""com.jcraft.jsch.jce.SignatureDSA""); config.put(""ssh-rsa"", ""com.jcraft.jsch.jce.SignatureRSA""); config.put(""rsa-sha2-256"", ""com.jcraft.jsch.jce.SignatureRSASHA256""); config.put(""rsa-sha2-512"", ""com.jcraft.jsch.jce.SignatureRSASHA512""); config.put(""ssh-rsa-sha224@ssh.com"", ""com.jcraft.jsch.jce.SignatureRSASHA224SSHCOM""); config.put(""ssh-rsa-sha256@ssh.com"", ""com.jcraft.jsch.jce.SignatureRSASHA256SSHCOM""); config.put(""ssh-rsa-sha384@ssh.com"", ""com.jcraft.jsch.jce.SignatureRSASHA384SSHCOM""); config.put(""ssh-rsa-sha512@ssh.com"", ""com.jcraft.jsch.jce.SignatureRSASHA512SSHCOM""); config.put(""keypairgen.dsa"", ""com.jcraft.jsch.jce.KeyPairGenDSA""); config.put(""keypairgen.rsa"", ""com.jcraft.jsch.jce.KeyPairGenRSA""); config.put(""keypairgen.ecdsa"", ""com.jcraft.jsch.jce.KeyPairGenECDSA""); config.put(""random"", ""com.jcraft.jsch.jce.Random""); config.put(""hmac-ripemd160"", ""com.jcraft.jsch.bc.HMACRIPEMD160""); config.put(""hmac-ripemd160@openssh.com"", ""com.jcraft.jsch.bc.HMACRIPEMD160OpenSSH""); config.put(""hmac-ripemd160-etm@openssh.com"", ""com.jcraft.jsch.bc.HMACRIPEMD160ETM""); config.put(""none"", ""com.jcraft.jsch.CipherNone""); config.put(""aes128-gcm@openssh.com"", ""com.jcraft.jsch.jce.AES128GCM""); config.put(""aes256-gcm@openssh.com"", ""com.jcraft.jsch.jce.AES256GCM""); config.put(""aes128-cbc"", ""com.jcraft.jsch.jce.AES128CBC""); config.put(""aes192-cbc"", ""com.jcraft.jsch.jce.AES192CBC""); config.put(""aes256-cbc"", ""com.jcraft.jsch.jce.AES256CBC""); config.put(""rijndael-cbc@lysator.liu.se"", ""com.jcraft.jsch.jce.AES256CBC""); config.put(""chacha20-poly1305@openssh.com"", ""com.jcraft.jsch.bc.ChaCha20Poly1305""); config.put(""cast128-cbc"", ""com.jcraft.jsch.bc.CAST128CBC""); config.put(""cast128-ctr"", ""com.jcraft.jsch.bc.CAST128CTR""); config.put(""twofish128-cbc"", ""com.jcraft.jsch.bc.Twofish128CBC""); config.put(""twofish192-cbc"", ""com.jcraft.jsch.bc.Twofish192CBC""); config.put(""twofish256-cbc"", ""com.jcraft.jsch.bc.Twofish256CBC""); config.put(""twofish-cbc"", ""com.jcraft.jsch.bc.Twofish256CBC""); config.put(""twofish128-ctr"", ""com.jcraft.jsch.bc.Twofish128CTR""); config.put(""twofish192-ctr"", ""com.jcraft.jsch.bc.Twofish192CTR""); config.put(""twofish256-ctr"", ""com.jcraft.jsch.bc.Twofish256CTR""); config.put(""seed-cbc@ssh.com"", ""com.jcraft.jsch.bc.SEEDCBC""); config.put(""aes128-ctr"", ""com.jcraft.jsch.jce.AES128CTR""); config.put(""aes192-ctr"", ""com.jcraft.jsch.jce.AES192CTR""); config.put(""aes256-ctr"", ""com.jcraft.jsch.jce.AES256CTR""); config.put(""3des-ctr"", ""com.jcraft.jsch.jce.TripleDESCTR""); config.put(""blowfish-ctr"", ""com.jcraft.jsch.jce.BlowfishCTR""); config.put(""arcfour"", ""com.jcraft.jsch.jce.ARCFOUR""); config.put(""arcfour128"", ""com.jcraft.jsch.jce.ARCFOUR128""); config.put(""arcfour256"", ""com.jcraft.jsch.jce.ARCFOUR256""); config.put(""userauth.none"", ""com.jcraft.jsch.UserAuthNone""); config.put(""userauth.password"", ""com.jcraft.jsch.UserAuthPassword""); config.put(""userauth.keyboard-interactive"", ""com.jcraft.jsch.UserAuthKeyboardInteractive""); config.put(""userauth.publickey"", ""com.jcraft.jsch.UserAuthPublicKey""); config.put(""userauth.gssapi-with-mic"", ""com.jcraft.jsch.UserAuthGSSAPIWithMIC""); config.put(""gssapi-with-mic.krb5"", ""com.jcraft.jsch.jgss.GSSContextKrb5""); config.put(""zlib"", ""com.jcraft.jsch.jzlib.Compression""); config.put(""zlib@openssh.com"", ""com.jcraft.jsch.jzlib.Compression""); config.put(""pbkdf2"", ""com.jcraft.jsch.jce.PBKDF2""); config.put(""bcrypt"", ""com.jcraft.jsch.jbcrypt.JBCrypt""); config.put(""Argon2d"", ""com.jcraft.jsch.bc.Argon2""); config.put(""Argon2i"", ""com.jcraft.jsch.bc.Argon2""); config.put(""Argon2id"", ""com.jcraft.jsch.bc.Argon2""); config.put(""scrypt"", ""com.jcraft.jsch.bc.SCrypt""); if (JavaVersion.getVersion() >= 11) { config.put(""xdh"", ""com.jcraft.jsch.jce.XDH""); } else { config.put(""xdh"", ""com.jcraft.jsch.bc.XDH""); } if (JavaVersion.getVersion() >= 15) { config.put(""keypairgen.eddsa"", ""com.jcraft.jsch.jce.KeyPairGenEdDSA""); config.put(""ssh-ed25519"", ""com.jcraft.jsch.jce.SignatureEd25519""); config.put(""ssh-ed448"", ""com.jcraft.jsch.jce.SignatureEd448""); } else { config.put(""keypairgen.eddsa"", ""com.jcraft.jsch.bc.KeyPairGenEdDSA""); config.put(""ssh-ed25519"", ""com.jcraft.jsch.bc.SignatureEd25519""); config.put(""ssh-ed448"", ""com.jcraft.jsch.bc.SignatureEd448""); } config.put(""keypairgen_fromprivate.eddsa"", ""com.jcraft.jsch.bc.KeyPairGenEdDSA""); config.put(""StrictHostKeyChecking"", ""ask""); config.put(""HashKnownHosts"", ""no""); config.put(""PreferredAuthentications"", Util.getSystemProperty(""jsch.preferred_authentications"", ""gssapi-with-mic,publickey,keyboard-interactive,password"")); config.put(""PubkeyAcceptedAlgorithms"", Util.getSystemProperty(""jsch.client_pubkey"", ""ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256"")); config.put(""enable_pubkey_auth_query"", Util.getSystemProperty(""jsch.enable_pubkey_auth_query"", ""yes"")); config.put(""try_additional_pubkey_algorithms"", Util.getSystemProperty(""jsch.try_additional_pubkey_algorithms"", ""yes"")); config.put(""enable_auth_none"", Util.getSystemProperty(""jsch.enable_auth_none"", ""yes"")); config.put(""use_sftp_write_flush_workaround"", Util.getSystemProperty(""jsch.use_sftp_write_flush_workaround"", ""yes"")); config.put(""CheckCiphers"", Util.getSystemProperty(""jsch.check_ciphers"", ""chacha20-poly1305@openssh.com"")); config.put(""CheckMacs"", Util.getSystemProperty(""jsch.check_macs"", """")); config.put(""CheckKexes"", Util.getSystemProperty(""jsch.check_kexes"", ""mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,curve448-sha512"")); config.put(""CheckSignatures"", Util.getSystemProperty(""jsch.check_signatures"", ""ssh-ed25519,ssh-ed448"")); config.put(""FingerprintHash"", Util.getSystemProperty(""jsch.fingerprint_hash"", ""sha256"")); config.put(""MaxAuthTries"", Util.getSystemProperty(""jsch.max_auth_tries"", ""6"")); config.put(""ClearAllForwardings"", ""no""); config.put(""host_certificate_to_key_fallback"", Util.getSystemProperty(""jsch.host_certificate_to_key_fallback"", ""yes"")); }",unrelated,encryption_key_operations,False,true_unrelated_predicted_encryption_key_operations,0.5420936346054077,0.45790645480155945
27,"try { Mac mac = Mac.getInstance(""HmacSHA512""); SecretKeySpec secret_key = new SecretKeySpec(Base64.decodeBase64(key), ""HmacSHA512""); mac.init(secret_key); byte[] buffer = builder.toString().getBytes(StandardCharsets.US_ASCII); byte[] signatureBytes = mac.doFinal(buffer); builder.append(""&Signature=""); builder.append(encode(Base64.encodeBase64String(signatureBytes))); } catch (IllegalStateException | InvalidKeyException | NoSuchAlgorithmException e) { throw new RuntimeException(e); }",encryption_key_operations,encryption_key_operations,True,,0.7063665986061096,0.2936333119869232
28,"@Override public byte[] getKey(byte[] pass, int size) { byte[] key = new byte[size]; bcrypt.pbkdf(pass, salt, iteration, key); return key; }",encryption_key_operations,encryption_key_operations,True,,0.5095204710960388,0.49047958850860596
29,"static String enc_s2c = ""blowfish-cbc"";",unrelated,unrelated,True,,0.023252520710229874,0.976747453212738
30,"private static final String OPENSSH_V1_KDFNAME = ""bcrypt"";",unrelated,unrelated,True,,0.0232376791536808,0.9767623543739319
31,"static String enc_c2s = ""blowfish-cbc"";",unrelated,unrelated,True,,0.02395077981054783,0.9760491847991943
32,"byte[] userDigestBytes = ConcurrentMessageDigest.digest(getAlgorithm(), inputCredentials.getBytes(StandardCharsets.ISO_8859_1), serverSaltBytes); return ConstantTime.equals(userDigestBytes, serverDigestBytes);",encryption_key_operations,encryption_key_operations,True,,0.6833142042160034,0.3166857659816742
33,"protected List<Factory.Named<Cipher>> getDefaultCipherFactories() { return new LinkedList<>(Arrays.<Factory.Named<Cipher>>asList( ChachaPolyCiphers.CHACHA_POLY_OPENSSH(), BlockCiphers.AES128CBC(), BlockCiphers.AES128CTR(), BlockCiphers.AES192CBC(), BlockCiphers.AES192CTR(), BlockCiphers.AES256CBC(), BlockCiphers.AES256CTR(), GcmCiphers.AES128GCM(), GcmCiphers.AES256GCM(), BlockCiphers.BlowfishCBC(),",encryption_key_operations,encryption_key_operations,True,,0.5444290637969971,0.45557093620300293
34,"try { SecretKeySpec skeySpec = new SecretKeySpec(key, ""Blowfish""); cipher = Cipher.getInstance(""Blowfish/CTR/NoPadding""); cipher.init( (mode == com.jcraft.jsch.Cipher.ENCRYPT_MODE ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE), skeySpec, new IvParameterSpec(iv)); } catch (Exception e) { throw e; } }",encryption_key_operations,encryption_key_operations,True,,0.7088873982429504,0.2911125421524048
35,"final byte[] serverChallenge = Base64.getDecoder().decode(getReplyString().substring(2).trim()); final Mac hmacMd5 = Mac.getInstance(MAC_ALGORITHM); hmacMd5.init(new SecretKeySpec(password.getBytes(getCharset()), MAC_ALGORITHM)); final byte[] hmacResult = convertToHexString(hmacMd5.doFinal(serverChallenge)).getBytes(getCharset());",encryption_key_operations,encryption_key_operations,True,,0.7067561745643616,0.2932438254356384
36,"real_salt = salt.substring(off + 3, off + 25); passwordb = (password + (minor >= 'a' ? ""\000"" : """")).getBytes(StandardCharsets.UTF_8); saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); B = new BCrypt(); hashed = B.crypt_raw(passwordb, saltb, rounds, bf_crypt_ciphertext.clone());",encryption_key_operations,encryption_key_operations,True,,0.7036162614822388,0.29638373851776123
37,"public BlowfishCBC() { super(8, 16, ""Blowfish"", ""Blowfish/CBC/NoPadding""); }",encryption_key_operations,unrelated,False,true_encryption_key_operations_predicted_unrelated,0.021306728944182396,0.9786932468414307
38,"public static String convertToPem(X509Certificate certificate) { String pemCert = """"; try { Base64 encoder = new Base64(64); String cert_begin = ""-----BEGIN CERTIFICATE-----\n""; String end_cert = ""-----END CERTIFICATE-----""; byte[] derCert = certificate.getEncoded(); String pemCertPre = new String(encoder.encode(derCert)); pemCert = cert_begin + pemCertPre + end_cert; } catch (Exception e) { LOGGER.debug(""Error converting certificate on PEM format: ""+ e.getMessage(), e); } return pemCert; }",unrelated,unrelated,True,,0.4524158537387848,0.5475841164588928
39,"public static String encodeBasicAuth(String username, String password, @Nullable Charset charset) { Assert.notNull(username, ""Username must not be null""); Assert.doesNotContain(username, "":"", ""Username must not contain a colon""); Assert.notNull(password, ""Password must not be null""); if (charset == null) { charset = StandardCharsets.ISO_8859_1; } CharsetEncoder encoder = charset.newEncoder(); if (!encoder.canEncode(username) || !encoder.canEncode(password)) { throw new IllegalArgumentException( ""Username or password contains characters that cannot be encoded to "" + charset.displayName()); } String credentialsString = username + "":"" + password; byte[] encodedBytes = Base64.getEncoder().encode(credentialsString.getBytes(charset)); return new String(encodedBytes, charset); }",unrelated,unrelated,True,,0.05910294130444527,0.9408970475196838
40,public byte[] decode(final String base64) { if (null == base64) { return null; } try { return getMimeDecoder().decode(base64); } catch (final IllegalArgumentException e) { return EMPTY_BYTES; } },unrelated,unrelated,True,,0.024161335080862045,0.9758387207984924
41,"public static PrivateKey loadPrivateKey(String keyString) throws GeneralSecurityException { String extractedKey = formatPrivateKey(keyString, false); extractedKey = chunkString(extractedKey, 64); KeyFactory kf = KeyFactory.getInstance(""RSA""); PrivateKey privKey; try { byte[] encoded = Base64.decodeBase64(extractedKey); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded); privKey = kf.generatePrivate(keySpec); } catch(IllegalArgumentException e) { privKey = null; }",encryption_key_operations,encryption_key_operations,True,,0.7051073908805847,0.29489263892173767
42,"Signature signature = Signature.getInstance(""SHA256withRSA""); signature.initSign(privateKeyObject); signature.update(stringToSign.getBytes(StandardCharsets.UTF_8)); byte[] signatureBytes = signature.sign(); return Base64.getEncoder().encodeToString(signatureBytes);",encryption_key_operations,encryption_key_operations,True,,0.6981959342956543,0.3018040657043457
43,"byte[] keyBytes = Base64.getDecoder().decode(privateKeyPEM); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(""RSA""); return keyFactory.generatePrivate(keySpec);",encryption_key_operations,encryption_key_operations,True,,0.6997202634811401,0.30027976632118225
44,"MessageDigest digest = MessageDigest.getInstance(""SHA-256""); byte[] hashedNotificationBodyJsonString = digest.digest(minifiedBody.getBytes()); String hashedNotificationBodyJsonStringHex = bytesToHex(hashedNotificationBodyJsonString) .toLowerCase(); String rawStringDataToVerifyAgainstSignature = ""POST"" + "":"" + this.notificationUrlPath + "":"" + hashedNotificationBodyJsonStringHex + "":"" + this.timeStamp; Signature verifier = Signature.getInstance(""SHA256withRSA""); verifier.initVerify(getPublicKey(SnapBiConfig.getSnapBiPublicKey())); verifier.update(rawStringDataToVerifyAgainstSignature.getBytes(StandardCharsets.UTF_8)); boolean isSignatureVerified = verifier.verify(Base64.getDecoder().decode(this.signature));",encryption_key_operations,encryption_key_operations,True,,0.6913629770278931,0.30863702297210693
45,"final KeyFactory factory; try { factory = KeyFactory.getInstance(KeyAlgorithm.RSA); } catch (NoSuchAlgorithmException s) { throw new IOException(s.getMessage(), s); } try { return new KeyPair(factory.generatePublic(new RSAPublicKeySpec(n, e)), factory.generatePrivate(new RSAPrivateKeySpec(n, d))); } catch (InvalidKeySpecException i) { throw new IOException(i.getMessage(), i); }",encryption_key_operations,encryption_key_operations,True,,0.6908037662506104,0.3091963231563568
46,"KeyPairGenerator keyGen = KeyPairGenerator.getInstance(""RSA""); keyGen.initialize(key_size, new SecureRandom()); KeyPair pair = keyGen.generateKeyPair(); PublicKey pubKey = pair.getPublic(); PrivateKey prvKey = pair.getPrivate(); d = ((RSAPrivateKey) prvKey).getPrivateExponent().toByteArray(); e = ((RSAPublicKey) pubKey).getPublicExponent().toByteArray(); n = ((RSAPrivateKey) prvKey).getModulus().toByteArray();",encryption_key_operations,encryption_key_operations,True,,0.705435574054718,0.2945643961429596
47,"String name = getName(); String foo = ""SHA1withRSA""; if (name.equals(""rsa-sha2-256"") || name.equals(""ssh-rsa-sha256@ssh.com"")) foo = ""SHA256withRSA""; else if (name.equals(""rsa-sha2-512"") || name.equals(""ssh-rsa-sha512@ssh.com"")) foo = ""SHA512withRSA""; else if (name.equals(""ssh-rsa-sha384@ssh.com"")) foo = ""SHA384withRSA""; else if (name.equals(""ssh-rsa-sha224@ssh.com"")) foo = ""SHA224withRSA""; signature = Signature.getInstance(foo); keyFactory = KeyFactory.getInstance(""RSA"");",encryption_key_operations,encryption_key_operations,True,,0.5913582444190979,0.4086417853832245
48,"static { OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.2"", ""MD2withRSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.4"", ""MD5withRSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.5"", ""SHA1withRSA""); OID_TO_NAME_MAP.put(""1.2.840.10040.4.3"", ""SHA1withDSA""); OID_TO_NAME_MAP.put(""1.2.840.10045.4.1"", ""SHA1withECDSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.14"", ""SHA224withRSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.11"", ""SHA256withRSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.12"", ""SHA384withRSA""); OID_TO_NAME_MAP.put(""1.2.840.113549.1.1.13"", ""SHA512withRSA""); OID_TO_NAME_MAP.put(""2.16.840.1.101.3.4.3.1"", ""SHA224withDSA""); OID_TO_NAME_MAP.put(""2.16.840.1.101.3.4.3.2"", ""SHA256withDSA""); OID_TO_NAME_MAP.put(""1.2.840.10045.4.3.1"", ""SHA224withECDSA""); OID_TO_NAME_MAP.put(""1.2.840.10045.4.3.2"", ""SHA256withECDSA""); OID_TO_NAME_MAP.put(""1.2.840.10045.4.3.3"", ""SHA384withECDSA""); OID_TO_NAME_MAP.put(""1.2.840.10045.4.3.4"", ""SHA512withECDSA""); }",unrelated,unrelated,True,,0.11846613138914108,0.8815338015556335
49,"private static PublicKey getPublicKey(String publicKeyString) throws Exception { String publicKeyPEM = publicKeyString .replace(""-----BEGIN PUBLIC KEY-----"", """") .replace(""-----END PUBLIC KEY-----"", """") .replaceAll(""\\s"", """"); byte[] keyBytes = Base64.getDecoder().decode(publicKeyPEM); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(""RSA""); return keyFactory.generatePublic(keySpec); }",encryption_key_operations,encryption_key_operations,True,,0.695617139339447,0.304382860660553
50,"static String[] mapSignatureAlgorithms(int[] algorithms) { if (algorithms == null || algorithms.length == 0) { return new String[] {""SHA256withRSA"", ""SHA256withECDSA"", ""SHA384withRSA"", ""SHA384withECDSA"", ""SHA512withRSA"", ""SHA512withECDSA"", ""SHA1withRSA"", ""SHA1withECDSA""}; } List<String> result = new ArrayList<>(); for (int alg : algorithms) { switch (alg) { case 0x0401: result.add(""SHA256withRSA""); break; case 0x0501: result.add(""SHA384withRSA""); break; case 0x0601: result.add(""SHA512withRSA""); break; case 0x0403: result.add(""SHA256withECDSA""); break; case 0x0503: result.add(""SHA384withECDSA""); break; case 0x0603: result.add(""SHA512withECDSA""); break; case 0x0804: case 0x0805: case 0x0806: case 0x0809: case 0x080a: case 0x080b: result.add(""RSASSA-PSS""); break; case 0x0807: result.add(""Ed25519""); break; case 0x0201: result.add(""SHA1withRSA""); break; case 0x0203: result.add(""SHA1withECDSA""); break; default: break; } } return result.toArray(new String[0]); }",unrelated,unrelated,True,,0.11571699380874634,0.8842829465866089
51,"@Override public String[] getLocalSupportedSignatureAlgorithms() { return new String[] { ""RSASSA-PSS"", ""Ed25519"", ""SHA512withRSA"", ""SHA512withECDSA"", ""SHA384withRSA"", ""SHA384withECDSA"", ""SHA256withRSA"", ""SHA256withECDSA"", ""SHA224withRSA"", ""SHA224withECDSA"", ""SHA1withRSA"", ""SHA1withECDSA""}; }",unrelated,unrelated,True,,0.14812664687633514,0.8518733382225037
52,"public static String signatureAlgConversion(String sign) { String convertedSignatureAlg = """"; if (sign == null) { convertedSignatureAlg = ""SHA1withRSA""; } else if (sign.equals(Constants.DSA_SHA1)) { convertedSignatureAlg = ""SHA1withDSA""; } else if (sign.equals(Constants.RSA_SHA256)) { convertedSignatureAlg = ""SHA256withRSA""; } else if (sign.equals(Constants.RSA_SHA384)) { convertedSignatureAlg = ""SHA384withRSA""; } else if (sign.equals(Constants.RSA_SHA512)) { convertedSignatureAlg = ""SHA512withRSA""; } else { convertedSignatureAlg = ""SHA1withRSA""; } return convertedSignatureAlg; }",unrelated,unrelated,True,,0.20815026760101318,0.7918497920036316
53,"protected ResultSetType resolveResultSetType(String alias) { try { return alias == null ? null : ResultSetType.valueOf(alias); } catch (IllegalArgumentException e) { throw new BuilderException(""Error resolving ResultSetType. Cause: "" + e, e); } }",unrelated,unrelated,True,,0.018507836386561394,0.9814921021461487
54,@Override public RandomProviderState saveState() { return new RandomProviderDefaultState(getStateInternal()); },unrelated,unrelated,True,,0.01895027793943882,0.9810497164726257
55,"private GuideTableDiscreteSampler(UniformRandomProvider rng, double[] cumulativeProbabilities, int[] guideTable) { this.rng = rng; this.cumulativeProbabilities = cumulativeProbabilities; this.guideTable = guideTable; }",unrelated,unrelated,True,,0.022965427488088608,0.9770345687866211
56,"private int skipWS(String expression, int p) { for (int i = p; i < expression.length(); i++) { if (expression.charAt(i) > 0x20) { return i; } } return expression.length(); }",unrelated,unrelated,True,,0.01825040765106678,0.9817495346069336
57,"private BoxMullerGaussianSampler(double mean, double standardDeviation, UniformRandomProvider rng) { super(null); this.rng = rng; this.mean = mean; this.standardDeviation = standardDeviation; }",unrelated,unrelated,True,,0.020314183086156845,0.9796858429908752
58,"private PoissonSamplerCache(int minN, int maxN, LargeMeanPoissonSamplerState[] states) { this.minN = minN; this.maxN = maxN; this.values = states; }",unrelated,unrelated,True,,0.020109102129936218,0.9798909425735474
59,@Override public long next() { final int p = bufferPosition; if (bufferPosition < PHILOX_BUFFER_SIZE) { bufferPosition = p + 1; return buffer[p]; } incrementCounter(); rand10(); bufferPosition = 1; return buffer[0]; },unrelated,unrelated,True,,0.02145066112279892,0.9785493016242981
60,public void setLogImpl(Class<? extends Log> logImpl) { if (logImpl != null) { this.logImpl = logImpl; LogFactory.useCustomLogging(this.logImpl); } },unrelated,unrelated,True,,0.019908195361495018,0.9800918102264404
61,@Override public UniformRandomProvider jump() { final UniformRandomProvider copy = new L32X64Mix(this); ls = M * ls + la; resetCachedState(); return copy; },unrelated,unrelated,True,,0.023414017632603645,0.9765859842300415
62,"private static void putInt(int v, byte[] buffer, int index) { buffer[index ] = (byte) (v & INT_LOWEST_BYTE_MASK); buffer[index + 1] = (byte)((v >>> 8) & INT_LOWEST_BYTE_MASK); buffer[index + 2] = (byte)((v >>> 16) & INT_LOWEST_BYTE_MASK); buffer[index + 3] = (byte) (v >>> 24); }",unrelated,unrelated,True,,0.029691722244024277,0.970308244228363
63,"private <E> List<E> selectList() throws SQLException { Executor localExecutor = executor; if (Thread.currentThread().getId() != this.creatorThreadId || localExecutor.isClosed()) { localExecutor = newExecutor(); } try { return localExecutor.query(mappedStatement, parameterObject, RowBounds.DEFAULT, Executor.NO_RESULT_HANDLER, cacheKey, boundSql); } finally { if (localExecutor != executor) { localExecutor.close(false); } } }",unrelated,unrelated,True,,0.02458019182085991,0.9754197597503662
64,public List<ResultMapping> resolveWithConstructor() { if (constructorResultMappings.isEmpty()) { return constructorResultMappings; } final List<ConstructorMetaInfo> matchingConstructorCandidates = retrieveConstructorCandidates( constructorResultMappings.size()); if (matchingConstructorCandidates.isEmpty()) { return constructorResultMappings; } final Set<String> constructorArgsByName = constructorResultMappings.stream().map(ResultMapping::getProperty) .filter(Objects::nonNull).collect(Collectors.toCollection(LinkedHashSet::new)); final boolean allMappingsHavePropertyNames = verifyPropertyNaming(constructorArgsByName);,unrelated,unrelated,True,,0.0278801079839468,0.9721198678016663
65,@Override public Class<?> getSetterType(String name) { PropertyTokenizer prop = new PropertyTokenizer(name); if (prop.hasNext()) { MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName()); if (metaValue == SystemMetaObject.NULL_META_OBJECT) { return Object.class; } else { return metaValue.getSetterType(prop.getChildren()); } } if (map.get(name) != null) { return map.get(name).getClass(); } else { return Object.class; } },unrelated,unrelated,True,,0.019958719611167908,0.9800412058830261
66,"private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings, String resultMapId) { final List<ResultMapping> mappings = new ArrayList<>(); for (Arg arg : args) { List<ResultFlag> flags = new ArrayList<>(); flags.add(ResultFlag.CONSTRUCTOR); if (arg.id()) { flags.add(ResultFlag.ID); } @SuppressWarnings(""unchecked"") Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>) (arg .typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler()); ResultMapping resultMapping = assistant.buildResultMapping(resultType, nullOrEmpty(arg.name()), nullOrEmpty(arg.column()), arg.javaType() == void.class ? null : arg.javaType(), arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(), nullOrEmpty(arg.select()), nullOrEmpty(arg.resultMap()), null, nullOrEmpty(arg.columnPrefix()), typeHandler, flags, null, null, false); mappings.add(resultMapping); } final ResultMappingConstructorResolver resolver = new ResultMappingConstructorResolver(configuration, mappings,",unrelated,unrelated,True,,0.024322550743818283,0.9756774306297302
67,private MetaObject getParamMetaObject() { if (paramMetaObject != null) { return paramMetaObject; } paramMetaObject = configuration.newMetaObject(parameterObject); return paramMetaObject; },unrelated,unrelated,True,,0.027308249846100807,0.9726917147636414
68,public int getActiveConnectionCount() { lock.lock(); try { return activeConnections.size(); } finally { lock.unlock(); } },unrelated,unrelated,True,,0.0218325387686491,0.9781674742698669
69,"@Override public BigDecimal getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getBigDecimal(columnName); }",unrelated,unrelated,True,,0.021711817011237144,0.9782881736755371
70,"@Override public void error(String s, Throwable e) { logger.log(MARKER, FQCN, LocationAwareLogger.ERROR_INT, s, null, e); }",unrelated,unrelated,True,,0.021506283432245255,0.9784936904907227
71,"public PreparedStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) { super(executor, mappedStatement, parameter, rowBounds, resultHandler, boundSql); }",unrelated,unrelated,True,,0.020649094134569168,0.9793509244918823
72,"private void parseSelectKeyNodes(String parentId, List<XNode> list, Class<?> parameterTypeClass, LanguageDriver langDriver, String skRequiredDatabaseId) { for (XNode nodeToHandle : list) { String id = parentId + SelectKeyGenerator.SELECT_KEY_SUFFIX; String databaseId = nodeToHandle.getStringAttribute(""databaseId""); if (databaseIdMatchesCurrent(id, databaseId, skRequiredDatabaseId)) { parseSelectKeyNode(id, nodeToHandle, parameterTypeClass, langDriver, databaseId); } } }",unrelated,unrelated,True,,0.02027885429561138,0.979721188545227
73,private void setState(long[] state) { key0 = state[0]; key1 = state[1]; counter0 = state[2]; counter1 = state[3]; counter2 = state[4]; counter3 = state[5]; },unrelated,unrelated,True,,0.019261930137872696,0.98073810338974
74,"public Class<?> getGetterType(String propertyName) { Class<?> clazz = getTypes.getOrDefault(propertyName, nullEntry).getValue(); if (clazz == null) { throw new ReflectionException(""There is no getter for property named '"" + propertyName + ""' in '"" + clazz + ""'""); } return clazz; }",unrelated,unrelated,True,,0.019238898530602455,0.9807611703872681
75,"@Override protected void setStateInternal(byte[] s) { final byte[][] c = splitStateInternal(s, (N + 1) * 4); final int[] tmp = NumberFactory.makeIntArray(c[0]); System.arraycopy(tmp, 0, mt, 0, N); mti = tmp[N]; super.setStateInternal(c[1]); }",unrelated,unrelated,True,,0.03024008497595787,0.9697599411010742
76,"@Override public <E> List<E> query(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException { BoundSql boundSql = ms.getBoundSql(parameterObject); CacheKey key = createCacheKey(ms, parameterObject, rowBounds, boundSql); return query(ms, parameterObject, rowBounds, resultHandler, key, boundSql); }",unrelated,unrelated,True,,0.02064858190715313,0.9793514013290405
77,private boolean isLazy(Result result) { boolean isLazy = configuration.isLazyLoadingEnabled(); if (!result.one().select().isEmpty() && FetchType.DEFAULT != result.one().fetchType()) { isLazy = result.one().fetchType() == FetchType.LAZY; } else if (!result.many().select().isEmpty() && FetchType.DEFAULT != result.many().fetchType()) { isLazy = result.many().fetchType() == FetchType.LAZY; } return isLazy; },unrelated,unrelated,True,,0.017588060349225998,0.9824119210243225
78,public CacheBuilder addDecorator(Class<? extends Cache> decorator) { if (decorator != null) { this.decorators.add(decorator); } return this; },unrelated,unrelated,True,,0.019402964040637016,0.9805970788002014
79,@Override public void clear() { lastClear = System.currentTimeMillis(); delegate.clear(); },unrelated,unrelated,True,,0.020225193351507187,0.9797748327255249
80,"@Override protected Statement instantiateStatement(Connection connection) throws SQLException { String sql = boundSql.getSql(); if (mappedStatement.getResultSetType() == ResultSetType.DEFAULT) { return connection.prepareCall(sql); } return connection.prepareCall(sql, mappedStatement.getResultSetType().getValue(), ResultSet.CONCUR_READ_ONLY); }",unrelated,unrelated,True,,0.0269017294049263,0.9730982184410095
81,"private static <T> SharedStateDiscreteSampler createSampler(UniformRandomProvider rng, List<T> collection, double[] probabilities) { if (probabilities.length != collection.size()) { throw new IllegalArgumentException(""Size mismatch: "" + probabilities.length + "" != "" + collection.size()); } return GuideTableDiscreteSampler.of(rng, probabilities); }",unrelated,unrelated,True,,0.02032732591032982,0.9796726703643799
82,"private ResultMapping buildResultMappingFromContext(XNode context, Class<?> resultType, List<ResultFlag> flags) { String property; if (flags.contains(ResultFlag.CONSTRUCTOR)) { property = context.getStringAttribute(""name""); } else { property = context.getStringAttribute(""property""); } String column = context.getStringAttribute(""column""); String javaType = context.getStringAttribute(""javaType""); String jdbcType = context.getStringAttribute(""jdbcType""); String nestedSelect = context.getStringAttribute(""select""); String nestedResultMap = context.getStringAttribute(""resultMap"", () -> processNestedResultMappings(context, List.of(), resultType)); String notNullColumn = context.getStringAttribute(""notNullColumn""); String columnPrefix = context.getStringAttribute(""columnPrefix""); String typeHandler = context.getStringAttribute(""typeHandler""); String resultSet = context.getStringAttribute(""resultSet""); String foreignColumn = context.getStringAttribute(""foreignColumn""); boolean lazy = ""lazy"" .equals(context.getStringAttribute(""fetchType"", configuration.isLazyLoadingEnabled() ? ""lazy"" : ""eager""));",unrelated,unrelated,True,,0.02480754256248474,0.9751924276351929
83,@Override public <E> Cursor<E> queryCursor(Statement statement) throws SQLException { return delegate.queryCursor(statement); },unrelated,unrelated,True,,0.019111135974526405,0.9808889031410217
84,"private JdbcType safeGetJdbcTypeForColumn(ResultSetMetaData rsmd, Integer columnIndex) { try { return JdbcType.forCode(rsmd.getColumnType(columnIndex)); } catch (Exception e) { return null; } }",unrelated,unrelated,True,,0.021304044872522354,0.9786959886550903
85,@Override public int next() { final int indexRm1 = TABLE.getIndexPred(index); final int v0 = v[index]; final int vM1 = v[TABLE.getIndexM1(index)]; final int vM2 = v[TABLE.getIndexM2(index)]; final int vM3 = v[TABLE.getIndexM3(index)]; final int z0 = v[indexRm1]; final int z1 = v0 ^ (vM1 ^ (vM1 >>> 8)); final int z2 = (vM2 ^ (vM2 << 19)) ^ (vM3 ^ (vM3 << 14)); final int z3 = z1 ^ z2; final int z4 = (z0 ^ (z0 << 11)) ^ (z1 ^ (z1 << 7)) ^ (z2 ^ (z2 << 13)); v[index] = z3; v[indexRm1] = z4; index = indexRm1; return z4;,unrelated,unrelated,True,,0.028024667873978615,0.9719753265380859
86,"private void linkToParents(ResultSet rs, ResultMapping parentMapping, Object rowValue) throws SQLException { CacheKey parentKey = createKeyForMultipleResults(rs, parentMapping, parentMapping.getColumn(), parentMapping.getForeignColumn()); List<PendingRelation> parents = pendingRelations.get(parentKey); if (parents != null) { for (PendingRelation parent : parents) { if (parent != null && rowValue != null) { linkObjects(parent.metaObject, parent.propertyMapping, rowValue); } } } }",unrelated,unrelated,True,,0.02079196460545063,0.9792080521583557
87,PendingCreationKey(ResultMapping constructorMapping) { this.resultMapId = constructorMapping.getNestedResultMapId(); this.constructorColumnPrefix = constructorMapping.getColumnPrefix(); },unrelated,unrelated,True,,0.025718457996845245,0.9742815494537354
88,"private static long sum(long[] frequencies) { if (frequencies == null || frequencies.length == 0) { throw new IllegalArgumentException(""frequencies must contain at least 1 value""); } long m = 0; long signFlag = 0; for (final long o : frequencies) { m += o; signFlag |= o | m; } if (signFlag < 0) { for (final long o : frequencies) { if (o < 0) {",unrelated,unrelated,True,,0.01944437436759472,0.9805555939674377
89,@Override public String[] getSetterNames() { return map.keySet().toArray(new String[0]); },unrelated,unrelated,True,,0.019373832270503044,0.9806262254714966
90,"private InverseTransformParetoSampler(double scale, double shape, UniformRandomProvider rng) { super(null); this.rng = rng; this.scale = scale; this.oneOverShape = 1 / shape; nextDouble = shape >= 1 ? InternalUtils::makeNonZeroDouble : InternalUtils::makeDouble; }",unrelated,unrelated,True,,0.020928040146827698,0.9790719151496887
91,public long getClaimedOverdueConnectionCount() { lock.lock(); try { return claimedOverdueConnectionCount; } finally { lock.unlock(); } },unrelated,unrelated,True,,0.021626634523272514,0.9783732891082764
92,"public static double[] shuffle(UniformRandomProvider rng, double[] array) { int i = array.length; for (; i > BATCH_2; --i) { swap(array, i - 1, rng.nextInt(i)); } final int[] productBound = {i * (i - 1)}; for (; i > 1; i -= 2) { final int[] indices = randomBounded2(i, i - 1, productBound, rng); final int index1 = indices[0]; final int index2 = indices[1]; swap(array, i - 1, index1); swap(array, i - 2, index2); } return array; }",unrelated,unrelated,True,,0.018390700221061707,0.9816092848777771
93,"@Override public Reader getNullableResult(ResultSet rs, String columnName) throws SQLException { return toReader(rs.getClob(columnName)); }",unrelated,unrelated,True,,0.021269792690873146,0.9787302613258362
94,"@Override public int next() { z = computeNew(36969, z); w = computeNew(18000, w); final int mwc = (z << 16) + w; jsr ^= jsr << 13; jsr ^= jsr >>> 17; jsr ^= jsr << 5; jcong = 69069 * jcong + 1234567; return (mwc ^ jcong) + jsr; }",unrelated,unrelated,True,,0.04617438092827797,0.9538255929946899
95,"@SuppressWarnings({""rawtypes"", ""unchecked""}) public static <T> void shuffle(UniformRandomProvider rng, List<T> list) { if (list instanceof RandomAccess || list.size() < RANDOM_ACCESS_SIZE_THRESHOLD) { ArraySampler.shuffle(rng, list); } else { final Object[] array = list.toArray(); ArraySampler.shuffle(rng, array); final ListIterator it = list.listIterator(); for (final Object item : array) { it.next(); it.set(item); } } }",unrelated,unrelated,True,,0.018407613039016724,0.9815923571586609
96,"private void cacheElement(XNode context) { if (context != null) { String type = context.getStringAttribute(""type"", ""PERPETUAL""); Class<? extends Cache> typeClass = typeAliasRegistry.resolveAlias(type); String eviction = context.getStringAttribute(""eviction"", ""LRU""); Class<? extends Cache> evictionClass = typeAliasRegistry.resolveAlias(eviction); Long flushInterval = context.getLongAttribute(""flushInterval""); Integer size = context.getIntAttribute(""size""); boolean readWrite = !context.getBooleanAttribute(""readOnly"", false); boolean blocking = context.getBooleanAttribute(""blocking"", false); Properties props = context.getChildrenAsProperties(); builderAssistant.useNewCache(typeClass, evictionClass, flushInterval, size, readWrite, blocking, props); } }",unrelated,unrelated,True,,0.019187645986676216,0.9808124303817749
97,"@Override protected void setStateInternal(byte[] s) { final byte[][] c = splitStateInternal(s, SEED_SIZE * 8); setState(NumberFactory.makeLongArray(c[0])); super.setStateInternal(c[1]); }",unrelated,unrelated,True,,0.025066707283258438,0.9749333262443542
98,"public static Type resolveFieldType(Field field, Type srcType) { Type fieldType = field.getGenericType(); Class<?> declaringClass = field.getDeclaringClass(); return resolveType(fieldType, srcType, declaringClass); }",unrelated,unrelated,True,,0.01827237382531166,0.9817276000976562
99,private void finishJump() { resetCachedState(); if (bufferPosition < PHILOX_BUFFER_SIZE) { rand10(); } },unrelated,unrelated,True,,0.027123918756842613,0.9728760123252869