Skip to content

Instantly share code, notes, and snippets.

@lovromazgon
lovromazgon / Rabbit.java
Last active August 28, 2024 23:57 — forked from Chase-san/Rabbit.java
Rabbit Stream Cipher
/**
* @see {@link http://tools.ietf.org/rfc/rfc4503.txt}
*/
public class Rabbit {
private static final int[] A = new int[] { 0x4D34D34D, 0xD34D34D3, 0x34D34D34, 0x4D34D34D, 0xD34D34D3, 0x34D34D34, 0x4D34D34D, 0xD34D34D3 };
private static final long MAX_UNSIGNED_INT = Integer.MAX_VALUE * 2l + 2; //2^32
private static final boolean DEBUG = false;
private int[] X;
private int[] C;