Code example for RC2ParameterSpec

Methods: hashCode

0
        byte[] iv = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
 
        RC2ParameterSpec ps1 = new RC2ParameterSpec(effectiveKeyBits, iv);
        RC2ParameterSpec ps2 = new RC2ParameterSpec(effectiveKeyBits, iv);
        RC2ParameterSpec ps3 = new RC2ParameterSpec(10,
                                    new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9}); 
 
        // checking for reflexive law: 
        assertTrue("The equivalence relation should be reflexive.",
                                                        ps1.equals(ps1));
 
        assertTrue("Objects built on the same parameters should be equal.",
                                                        ps1.equals(ps2));
        // checking for symmetric law: 
        assertTrue("The equivalence relation should be symmetric.",
                                                        ps2.equals(ps1));
 
        assertTrue("Objects built on the equal parameters should be equal.",
                                                        ps2.equals(ps3));
 
        // checking for transitive law: