public static byte[] calculateAuthValueSecureNetBeacon(@NonNull final byte[] n,
                                                           final int flags,
                                                           @NonNull final byte[] networkId,
                                                           final int ivIndex) {
        final int inputLength = 1 + networkId.length + 4;
        final ByteBuffer pBuffer = ByteBuffer.allocate(inputLength);
        pBuffer.put((byte) flags);
        pBuffer.put(networkId);
        pBuffer.putInt(ivIndex);
        final byte[] beaconKey = calculateBeaconKey(n);
        return calculateCMAC(pBuffer.array(), beaconKey);
    }
Calculates the authentication value of secure network beacon

@param n         network key
@param flags     flags
@param networkId network id of the network
@param ivIndex   ivindex of the network
mesh/src/main/java/no/nordicsemi/android/mesh/utils/SecureUtils.java