Argon2BytesGenerator (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.crypto.generators

## Class Argon2BytesGenerator

- java.lang.Object
- - org.bouncycastle.crypto.generators.Argon2BytesGenerator

-     public class Argon2BytesGenerator
      extends java.lang.Object

  Argon2 PBKDF - Based on the results of https://password-hashing.net/ and https://www.ietf.org/archive/id/draft-irtf-cfrg-argon2-03.txt

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Argon2BytesGenerator.Block` A single 1024-byte memory block used by the Argon2 mixing function.
    `static interface` | `Argon2BytesGenerator.BlockPool` Strategy for allocating and recycling Argon2 `Argon2BytesGenerator.Block` objects.
    `static class` | `Argon2BytesGenerator.FixedBlockPool` Bounded pool that recycles up to `maxBlocks` `Argon2BytesGenerator.Block` objects.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Argon2BytesGenerator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `generateBytes(byte[] password, byte[] out)`
    `int` | `generateBytes(byte[] password, byte[] out, int outOff, int outLen)`
    `int` | `generateBytes(char[] password, byte[] out)`
    `int` | `generateBytes(char[] password, byte[] out, int outOff, int outLen)`
    `void` | `init(Argon2Parameters parameters)` Initialise the Argon2BytesGenerator from the parameters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Argon2BytesGenerator

          public Argon2BytesGenerator()

  - ### Method Detail

    - #### init

          public void init(Argon2Parameters parameters)

      Initialise the Argon2BytesGenerator from the parameters.
      Parameters:
        `parameters` - Argon2 configuration.

    - #### generateBytes

          public int generateBytes(char[] password,
                                   byte[] out)

    - #### generateBytes

          public int generateBytes(char[] password,
                                   byte[] out,
                                   int outOff,
                                   int outLen)

    - #### generateBytes

          public int generateBytes(byte[] password,
                                   byte[] out)

    - #### generateBytes

          public int generateBytes(byte[] password,
                                   byte[] out,
                                   int outOff,
                                   int outLen)