Skip to content

Commit

Permalink
Use PasscodeId in NodeId functions (#14960)
Browse files Browse the repository at this point in the history
Instead of underlying uint16_t type.

Part of issue #14439
  • Loading branch information
mlepage-google authored and pull[bot] committed Sep 22, 2023
1 parent 237f270 commit 3581498
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/core/NodeId.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once

#include <lib/core/GroupId.h>
#include <lib/core/PasscodeId.h>

#include <cstdint>

Expand Down Expand Up @@ -79,12 +80,12 @@ constexpr NodeId NodeIdFromGroupId(GroupId aGroupId)
return kMinGroupNodeId | aGroupId;
}

constexpr NodeId NodeIdFromPAKEKeyId(uint16_t aPAKEKeyId)
constexpr NodeId NodeIdFromPAKEKeyId(PasscodeId aPAKEKeyId)
{
return kMinPAKEKeyId | aPAKEKeyId;
}

constexpr uint16_t PAKEKeyIdFromNodeId(NodeId aNodeId)
constexpr PasscodeId PAKEKeyIdFromNodeId(NodeId aNodeId)
{
return aNodeId & kMaskPAKEKeyId;
}
Expand Down

0 comments on commit 3581498

Please sign in to comment.