test_class.declarator: TEST_MNEMONIC = "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will"
test_class.modifier: static final
test_class.original_string: static final String TEST_MNEMONIC = "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will";
test_class.type: String
test_class.var_name: TEST_MNEMONIC
test_class.file: jlibra-core/src/test/java/dev/jlibra/mnemonic/LibraKeyFactoryTest.java
test_class.identifier: LibraKeyFactoryTest
test_case.body: @Test
      public void privateChild() {
          Mnemonic mnemonic = Mnemonic.fromString(TEST_MNEMONIC);
          Seed seed = new Seed(mnemonic, "LIBRA");
          LibraKeyFactory libraKeyFactory = new LibraKeyFactory(seed);
  
          // Check child_0 key derivation.
          ExtendedPrivKey childPrivate0 = libraKeyFactory.privateChild(new ChildNumber(0));
  
          assertEquals(
                  "3051020101300506032b657004220420358a375f36d74c30b7f3299b62d712b307725938f8cc931100fbd10a434fc8b9812100b1894672e853ee6d2f1c094b0db2c2644edd4736f46c4357c709fdded5797c44",
                  Hex.toHexString(childPrivate0.privateKey.getEncoded()));
  
          // Check determinism, regenerate child_0.
          ExtendedPrivKey childPrivate0_again = libraKeyFactory.privateChild(new ChildNumber(0));
          assertEquals(
                  Hex.toHexString(childPrivate0.privateKey.getEncoded()),
                  Hex.toHexString(childPrivate0_again.privateKey.getEncoded()));
  
          // Check child_1 key derivation.
          ExtendedPrivKey childPrivate1 = libraKeyFactory.privateChild(new ChildNumber(1));
          assertEquals(
                  "3051020101300506032b657004220420a325fe7d27b1b49f191cc03525951fec41b6ffa2d4b3007bb1d9dd353b7e56a6812100c66551332920eda683a977292305ef6c10c34b27d9fef331bbd851f5c74d09ee",
                  Hex.toHexString(childPrivate1.privateKey.getEncoded()));
  
          ChildNumber child1Again = new ChildNumber(0).increment();
          assertEquals(new ChildNumber(1).data, child1Again.data);
  
          // Check determinism, regenerate child_1, but by incrementing ChildNumber(0).
          ExtendedPrivKey childPrivate1FromIncrement = libraKeyFactory.privateChild(child1Again);
          assertEquals(
                  "3051020101300506032b657004220420a325fe7d27b1b49f191cc03525951fec41b6ffa2d4b3007bb1d9dd353b7e56a6812100c66551332920eda683a977292305ef6c10c34b27d9fef331bbd851f5c74d09ee",
                  Hex.toHexString(childPrivate1FromIncrement.privateKey.getEncoded()));
      }
test_case.class_method_signature: LibraKeyFactoryTest.privateChild()
test_case.full_signature: @Test public void privateChild()
test_case.identifier: privateChild
test_case.invocations: fromString privateChild assertEquals toHexString getEncoded privateChild assertEquals toHexString getEncoded toHexString getEncoded privateChild assertEquals toHexString getEncoded increment assertEquals privateChild assertEquals toHexString getEncoded
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void privateChild()
focal_class.declarator: MASTER_KEY_SALT = "LIBRA WALLET: master key salt$".getBytes(StandardCharsets.UTF_8)
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] MASTER_KEY_SALT = "LIBRA WALLET: master key salt$".getBytes(StandardCharsets.UTF_8);
focal_class.type: byte[]
focal_class.var_name: MASTER_KEY_SALT
focal_class.declarator: INFO_PREFIX = "LIBRA WALLET: derived key$".getBytes(StandardCharsets.UTF_8)
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] INFO_PREFIX = "LIBRA WALLET: derived key$".getBytes(StandardCharsets.UTF_8);
focal_class.type: byte[]
focal_class.var_name: INFO_PREFIX
focal_class.declarator: master
focal_class.modifier: private final
focal_class.original_string: private final Master master;
focal_class.type: Master
focal_class.var_name: master
focal_class.file: jlibra-core/src/main/java/dev/jlibra/mnemonic/LibraKeyFactory.java
focal_class.identifier: LibraKeyFactory
focal_class.class_method_signature: LibraKeyFactory.LibraKeyFactory(Seed seed)
focal_class.full_signature: public  LibraKeyFactory(Seed seed)
focal_class.identifier: LibraKeyFactory
focal_class.modifiers: public
focal_class.parameters: (Seed seed)
focal_class.signature:  LibraKeyFactory(Seed seed)
focal_class.class_method_signature: LibraKeyFactory.getMaster()
focal_class.full_signature: public Master getMaster()
focal_class.identifier: getMaster
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Master
focal_class.signature: Master getMaster()
focal_class.class_method_signature: LibraKeyFactory.privateChild(ChildNumber childNumber)
focal_class.full_signature: public ExtendedPrivKey privateChild(ChildNumber childNumber)
focal_class.identifier: privateChild
focal_class.modifiers: public
focal_class.parameters: (ChildNumber childNumber)
focal_class.return: ExtendedPrivKey
focal_class.signature: ExtendedPrivKey privateChild(ChildNumber childNumber)
focal_class.class_method_signature: LibraKeyFactory.createInfo(ChildNumber childNumber)
focal_class.full_signature: private byte[] createInfo(ChildNumber childNumber)
focal_class.identifier: createInfo
focal_class.modifiers: private
focal_class.parameters: (ChildNumber childNumber)
focal_class.return: byte[]
focal_class.signature: byte[] createInfo(ChildNumber childNumber)
focal_method.body: public ExtendedPrivKey privateChild(ChildNumber childNumber) {
          byte[] secretKey = new byte[32];
          byte[] info = createInfo(childNumber);
          SHA3Digest sha3 = new SHA3Digest(256);
          HKDFBytesGenerator hkdf = new HKDFBytesGenerator(sha3);
          hkdf.init(HKDFParameters.skipExtractParameters(master.getData(), info));
          hkdf.generateBytes(secretKey, 0, 32);
  
          return new ExtendedPrivKey(new SecretKey(ByteArray.from(secretKey)));
      }
focal_method.class_method_signature: LibraKeyFactory.privateChild(ChildNumber childNumber)
focal_method.full_signature: public ExtendedPrivKey privateChild(ChildNumber childNumber)
focal_method.identifier: privateChild
focal_method.invocations: createInfo init skipExtractParameters getData generateBytes from
focal_method.modifiers: public
focal_method.parameters: (ChildNumber childNumber)
focal_method.return: ExtendedPrivKey
focal_method.signature: ExtendedPrivKey privateChild(ChildNumber childNumber)