Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SkippingCipher.java « crypto « spongycastle « org « java « main « src « core - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 653182cd8367607c05320784f029f904f01db11b (plain)
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
package org.spongycastle.crypto;

/**
 * Ciphers producing a key stream which can be reset to particular points in the stream implement this.
 */
public interface SkippingCipher
{
    /**
     * Skip numberOfBytes forwards, or backwards.
     *
     * @param numberOfBytes the number of bytes to skip (positive forward, negative backwards).
     * @return the number of bytes actually skipped.
     * @throws java.lang.IllegalArgumentException if numberOfBytes is an invalid value.
     */
    long skip(long numberOfBytes);

    /**
     * Reset the cipher and then skip forward to a given position.
     *
     * @param position the number of bytes in to set the cipher state to.
     * @return the byte position moved to.
     */
    long seekTo(long position);

    /**
     * Return the current "position" of the cipher
     *
     * @return the current byte position.
     */
    long getPosition();
}