Skip to contents

HQC-128 decapsulation

Usage

morie_crypto_hqc_decaps(sk, ct)

Arguments

sk

Secret key.

ct

Ciphertext from morie_crypto_hqc_encaps.

Value

Raw shared secret.

Examples

if (morie_crypto_liboqs_available()) {
  kp <- try(morie_crypto_hqc_keygen(), silent = TRUE)
  if (!inherits(kp, "try-error")) {
    enc <- morie_crypto_hqc_encaps(kp$pk)
    ss <- morie_crypto_hqc_decaps(kp$sk, enc$ct)
    print(identical(ss, enc$shared_secret))
  }
}