lib/sp_store/p_chip/soft_boot_logic.rb
# Instantiates a software model of the P chip's boot logic module.
#
# Args:
#   p_key:: the P chip's symmetric key; was generated during the manufacturing
#           process
#   ca_public_key:: the public key of the S-P chip pair's manufacturer root
#                   CA; this is burned in the P chip's ROM
#   observer:: receives call to booted and reset as part of the boot process
Instantiates a software model of the P chip's boot logic module.
Instantiates a software model of the P chip ' s boot logic module .
def boot_start(puf_syndrome, endorsement_certificate)
    raise RuntimeError, 'Already called boot_start' if @boot_nonce
    if Crypto.crypto_hash(@p_key) != puf_syndrome
      raise RuntimeError, 'Invalid PUF syndrome'
    end
    if !SpStore::Crypto.verify_cert_ca_key(endorsement_certificate, @ca_pubkey)
      raise RuntimeError, 'Invalid endorsement certificate'
    end
    @endorsement_certificate = endorsement_certificate
    @boot_nonce = Crypto.nonce
    return Crypto.sk_encrypt(@p_key, @boot_nonce),
           Crypto.hmac(@p_key, @boot_nonce)
  end
def boot_start ( puf_syndrome , endorsement_certificate ) raise RuntimeError , 'Already called boot_start' if @boot_nonce if Crypto . crypto_hash ( @p_key ) != puf_syndrome raise RuntimeError , 'Invalid PUF syndrome' end if ! SpStore :: Crypto . verify_cert_ca_key ( endorsement_certificate , @ca_pubkey ) raise RuntimeError , 'Invalid endorsement certificate' end @endorsement_certificate = endorsement_certificate @boot_nonce = Crypto . nonce return Crypto . sk_encrypt ( @p_key , @boot_nonce ) , Crypto . hmac ( @p_key , @boot_nonce ) end
Instantiates a software model of the P chip's boot logic module.
Instantiates a software model of the P chip ' s boot logic module .
# State check. # Argument check. # State transition.
puf_syndrome
endorsement_certificate