Code example for RC5ParameterSpec

Methods: hashCode

0
        int rounds = 5;
        int wordSize = 16;
        byte[] iv = {1, 2, 3, 4, 5, 6};
 
        RC5ParameterSpec ps1 = new RC5ParameterSpec(version, rounds,
                                                                wordSize, iv);
        RC5ParameterSpec ps2 = new RC5ParameterSpec(version, rounds,
                                                                wordSize, iv);
        RC5ParameterSpec ps3 = new RC5ParameterSpec(version, rounds, wordSize,
                                                    new byte[] {1, 2, 3, 4}); 
        // 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.",