# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")
import("${chip_root}/src/crypto/crypto.gni")

chip_test_suite_using_nltest("tests") {
  output_name = "libChipCryptoTests"

  sources = [
    "AES_CCM_128_test_vectors.h",
    "DacValidationExplicitVectors.h",
    "DerSigConversion_test_vectors.h",
    "ECDH_P256_test_vectors.h",
    "HKDF_SHA256_test_vectors.h",
    "HMAC_SHA256_test_vectors.h",
    "Hash_SHA256_test_vectors.h",
    "PBKDF2_SHA256_test_vectors.h",
    "PBKDF2_SHA256_test_vectors.h",
    "RawIntegerToDer_test_vectors.h",
    "SPAKE2P_FE_MUL_test_vectors.h",
    "SPAKE2P_FE_RW_test_vectors.h",
    "SPAKE2P_HMAC_test_vectors.h",
    "SPAKE2P_POINT_MUL_ADD_test_vectors.h",
    "SPAKE2P_POINT_MUL_test_vectors.h",
    "SPAKE2P_POINT_RW_test_vectors.h",
    "SPAKE2P_POINT_VALID_test_vectors.h",
    "SPAKE2P_RFC_test_vectors.h",
    "TestCryptoLayer.h",
  ]

  test_sources = [
    "TestChipCryptoPAL.cpp",
    "TestGroupOperationalCredentials.cpp",
    "TestSessionKeystore.cpp",
  ]

  if (chip_crypto == "psa") {
    test_sources += [ "TestPSAOpKeyStore.cpp" ]
  } else {
    test_sources += [ "TestPersistentStorageOpKeyStore.cpp" ]
  }

  if (chip_device_platform == "esp32" || chip_device_platform == "nrfconnect" ||
      chip_device_platform == "efr32" || chip_device_platform == "nxp" ||
      chip_device_platform == "openiotsdk") {
    defines = [ "CURRENT_TIME_NOT_IMPLEMENTED=1" ]
  }

  cflags = [ "-Wconversion" ]

  public_deps = [
    "${chip_root}/src/credentials:test_paa_store",
    "${chip_root}/src/credentials/tests:cert_test_vectors",
    "${chip_root}/src/crypto",
    "${chip_root}/src/lib/core",
    "${chip_root}/src/lib/support:testing",
    "${chip_root}/src/lib/support:testing_nlunit",
    "${chip_root}/src/platform",
    "${nlunit_test_root}:nlunit-test",
  ]
}
