Buggy code:
@ Override public SecureDESKey importKeyImpl ( short keyLength , String keyType , byte [ ] encryptedKey , SecureDESKey kek , boolean checkParity ) throws SMException { } @ Override public byte [ ] exportKeyImpl ( SecureDESKey key , SecureDESKey kek ) throws SMException { } private int getKeyTypeIndex ( short keyLength , String keyType ) throws SMException { } private static KeyScheme getScheme ( int keyLength , String keyType ) { } @ Override public EncryptedPIN encryptPINImpl ( String pin , String accountNumber ) throws SMException { } @ Override public String decryptPINImpl ( EncryptedPIN pinUnderLmk ) throws SMException { } @ Override public EncryptedPIN importPINImpl ( EncryptedPIN pinUnderKd1 , SecureDESKey kd1 ) throws SMException { } @ Override public EncryptedPIN exportPINImpl ( EncryptedPIN pinUnderLmk , SecureDESKey kd2 , byte destinationPINBlockFormat ) throws SMException { } @ Override public EncryptedPIN generatePINImpl ( String accountNumber , int pinLen , List < String > excludes ) throws SMException { } private static String decimalizeVisa ( byte [ ] b ) { } private Key concatKeys ( SecureDESKey keyA , SecureDESKey keyB ) throws SMException { } private String calculateCVV ( String accountNo , Key cvk , Date expDate , String serviceCode ) throws SMException { } private String calculateCVD ( String accountNo , Key cvk , String expDate , String serviceCode ) throws SMException { } @ Override protected String calculateCVVImpl ( String accountNo , SecureDESKey cvkA , SecureDESKey cvkB , Date expDate , String serviceCode ) throws SMException { } protected void checkCAVVArgs ( String upn , String authrc , String sfarc ) throws SMException { } @ Override protected String calculateCAVVImpl ( String accountNo , SecureDESKey cvk , String upn , String authrc , String sfarc ) throws SMException { } @ Override protected boolean verifyCVVImpl ( String accountNo , SecureDESKey cvkA , SecureDESKey cvkB , String cvv , Date expDate , String serviceCode ) throws SMException { } @ Override protected boolean verifyCAVVImpl ( String accountNo , SecureDESKey cvk , String cavv , String upn , String authrc , String sfarc ) throws SMException { } @ Override protected boolean verifydCVVImpl ( String accountNo , SecureDESKey imkac , String dcvv , Date expDate , String serviceCode , byte [ ] atc , MKDMethod mkdm ) throws SMException { } @ Override protected boolean verifyCVC3Impl ( SecureDESKey imkcvc3 , String accountNo , String acctSeqNo , byte [ ] atc , byte [ ] upn , byte [ ] data , MKDMethod mkdm , String cvc3 ) throws SMException { } private byte [ ] calculateIVCVC3 ( Key mkcvc3 , byte [ ] data ) throws JCEHandlerException { } private byte [ ] paddingISO9797Method2 ( byte [ ] d ) { } private byte [ ] calculateMACISO9797Alg3 ( Key key , byte [ ] d ) throws JCEHandlerException { } private static byte [ ] formatPANPSN ( String pan , String psn , MKDMethod mkdm ) throws SMException { } private static byte [ ] preparePANPSN ( String pan , String psn ) { } private static byte [ ] formatPANPSNOptionA ( String pan , String psn ) { } private static byte [ ] formatPANPSNOptionB ( String pan , String psn ) { } private Key deriveICCMasterKey ( Key imk , byte [ ] panpsn ) throws JCEHandlerException { } private String calculatePVV ( EncryptedPIN pinUnderLmk , Key key , int keyIdx , List < String > excludes ) throws SMException { } @ Override protected String calculatePVVImpl ( EncryptedPIN pinUnderLmk , SecureDESKey pvkA , SecureDESKey pvkB , int pvkIdx , List < String > excludes ) throws SMException { } @ Override protected String calculatePVVImpl ( EncryptedPIN pinUnderKd1 , SecureDESKey kd1 , SecureDESKey pvkA , SecureDESKey pvkB , int pvkIdx , List < String > excludes ) throws SMException { Key key = concatKeys ( pvkA , pvkB ) ; <START_BUG> EncryptedPIN pinUnderLmk = importPIN ( pinUnderKd1 , kd1 ) ; <END_BUG> return calculatePVV ( pinUnderLmk , key , pvkIdx , excludes ) ; } @ Override public boolean verifyPVVImpl ( EncryptedPIN pinUnderKd1 , SecureDESKey kd1 , SecureDESKey pvkA , SecureDESKey pvkB , int pvki , String pvv ) throws SMException { } @ Override public EncryptedPIN translatePINImpl ( EncryptedPIN pinUnderKd1 , SecureDESKey kd1 , SecureDESKey kd2 , byte destinationPINBlockFormat ) throws SMException { } private EncryptedPIN translatePINExt ( EncryptedPIN oldPinUnderKd1 , EncryptedPIN pinUnderKd1 , Key kd1 , Key kd2 , byte destinationPINBlockFormat , Key udk , PaddingMethod padm ) throws SMException { } private Key deriveSK_VISA ( Key mkac , byte [ ] atc ) throws JCEHandlerException { } private Key deriveCommonSK_SM ( Key mksm , byte [ ] rand ) throws JCEHandlerException { } @ Override protected byte [ ] generateSM_MACImpl ( MKDMethod mkdm , SKDMethod skdm , SecureDESKey imksmi , String accountNo , String accntSeqNo , byte [ ] atc , byte [ ] arqc , byte [ ] data ) throws SMException { } @ Override protected Pair < EncryptedPIN , byte [ ] > translatePINGenerateSM_MACImpl ( MKDMethod mkdm , SKDMethod skdm , PaddingMethod padm , SecureDESKey imksmi , String accountNo , String accntSeqNo , byte [ ] atc , byte [ ] arqc , byte [ ] data , EncryptedPIN currentPIN , EncryptedPIN newPIN , SecureDESKey kd1 , SecureDESKey imksmc , SecureDESKey imkac , byte destinationPINBlockFormat ) throws SMException { } private boolean isVSDCPinBlockFormat ( byte pinBlockFormat ) { } @ Override protected byte [ ] generateCBC_MACImpl ( byte [ ] data , SecureDESKey kd ) throws SMException { } @ Override protected byte [ ] generateEDE_MACImpl ( byte [ ] data , SecureDESKey kd ) throws SMException { } private byte [ ] generateMACImpl ( byte [ ] data , SecureDESKey kd , String macAlgorithm , LogEvent evt ) throws SMException { } String generateClearKeyComponent ( short keyLength ) throws SMException { } @ Override protected byte [ ] generateKeyCheckValueImpl ( SecureDESKey secureDESKey ) throws SMException { }

Fix:
EncryptedPIN pinUnderLmk = importPINImpl ( pinUnderKd1 , kd1 ) ;