Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e052c883 authored by Joël Stemmer's avatar Joël Stemmer
Browse files

Update language to comply with Android's inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: refactoring CL, existing tests still pass. Verified by running
 `atest HkdfTest.java` in the corresponding test directory.
Change-Id: If6154e6d75eab4b2c97bdc08f5eebdba4cf45249
parent 84e70df9
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -40,18 +40,18 @@ public final class Hkdf {
     *
     *
     * <p>IMPORTANT: The use or edit of this method requires a security review.
     * <p>IMPORTANT: The use or edit of this method requires a security review.
     *
     *
     * @param masterKey Master key from which to derive sub-keys.
     * @param mainKey Main key from which to derive sub-keys.
     * @param salt A randomly generated 256-bit byte string.
     * @param salt A randomly generated 256-bit byte string.
     * @param data Arbitrary information that is bound to the derived key (i.e., used in its
     * @param data Arbitrary information that is bound to the derived key (i.e., used in its
     *     creation).
     *     creation).
     * @return Raw derived key bytes = HKDF-SHA256(masterKey, salt, data).
     * @return Raw derived key bytes = HKDF-SHA256(mainKey, salt, data).
     * @throws InvalidKeyException If the salt can not be used as a valid key.
     * @throws InvalidKeyException If the salt can not be used as a valid key.
     */
     */
    static byte[] hkdf(byte[] masterKey, byte[] salt, byte[] data) throws InvalidKeyException {
    static byte[] hkdf(byte[] mainKey, byte[] salt, byte[] data) throws InvalidKeyException {
        Objects.requireNonNull(masterKey, "HKDF requires master key to be set.");
        Objects.requireNonNull(mainKey, "HKDF requires main key to be set.");
        Objects.requireNonNull(salt, "HKDF requires a salt.");
        Objects.requireNonNull(salt, "HKDF requires a salt.");
        Objects.requireNonNull(data, "No data provided to HKDF.");
        Objects.requireNonNull(data, "No data provided to HKDF.");
        return hkdfSha256Expand(hkdfSha256Extract(masterKey, salt), data);
        return hkdfSha256Expand(hkdfSha256Extract(mainKey, salt), data);
    }
    }


    private Hkdf() {}
    private Hkdf() {}