MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / DeriveLegacyAppSKey

Function DeriveLegacyAppSKey

pkg/crypto/key_derivation.go:71–73  ·  view source on GitHub ↗

DeriveLegacyAppSKey derives the LoRaWAN Application Session Key - If a LoRaWAN 1.0 device joins a LoRaWAN 1.0/1.1 network, the AppKey is used as "key" - If a LoRaWAN 1.1 device joins a LoRaWAN 1.0 network, the NwkKey is used as "key"

(key types.AES128Key, jn types.JoinNonce, nid types.NetID, dn types.DevNonce)

Source from the content-addressed store, hash-verified

69// - If a LoRaWAN 1.0 device joins a LoRaWAN 1.0/1.1 network, the AppKey is used as "key"
70// - If a LoRaWAN 1.1 device joins a LoRaWAN 1.0 network, the NwkKey is used as "key"
71func DeriveLegacyAppSKey(key types.AES128Key, jn types.JoinNonce, nid types.NetID, dn types.DevNonce) types.AES128Key {
72 return deriveLegacySKey(key, 0x02, jn, nid, dn)
73}
74
75// DeriveLegacyNwkSKey derives the LoRaWAN 1.0 Network Session Key. AppNonce is entered as JoinNonce.
76// - If a LoRaWAN 1.0 device joins a LoRaWAN 1.0/1.1 network, the AppKey is used as "key"

Callers 5

DeriveAppSKeyMethod · 0.92
TestHandleJoinFunction · 0.92
test.goFile · 0.92
processDownlinkFunction · 0.92
TestKeyDerivationFunction · 0.85

Calls 1

deriveLegacySKeyFunction · 0.85

Tested by 2

TestHandleJoinFunction · 0.74
TestKeyDerivationFunction · 0.68