CoRE Working Group                                             M. Tiloca
Internet-Draft                                                   RISE AB
Intended status: Standards Track                             G. Selander
Expires: August 26, 2021 13 January 2022                                    F. Palombini
                                                             J. Mattsson
                                                             Ericsson AB
                                                                 J. Park
                                             Universitaet Duisburg-Essen
                                                       February 22,
                                                            12 July 2021

           Group OSCORE - Secure Group Communication for CoAP
                  draft-ietf-core-oscore-groupcomm-11
                  draft-ietf-core-oscore-groupcomm-12

Abstract

   This document defines Group Object Security for Constrained RESTful
   Environments (Group OSCORE), providing end-to-end security of CoAP
   messages exchanged between members of a group, e.g. e.g., sent over IP
   multicast.  In particular, the described approach defines how OSCORE
   is used in a group communication setting to provide source
   authentication for CoAP group requests, sent by a client to multiple
   servers, and for protection of the corresponding CoAP responses.
   Group OSCORE also defines a pairwise mode where each member of the
   group can efficiently derive a symmetric pairwise key with any other
   member of the group for pairwise OSCORE communication.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on August 26, 2021. 13 January 2022.

Copyright Notice

   Copyright (c) 2021 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Simplified BSD License text
   as described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   6
   2.  Security Context  . . . . . . . . . . . . . . . . . . . . . .   7   8
     2.1.  Common Context  . . . . . . . . . . . . . . . . . . . . .   9  10
       2.1.1.  AEAD Algorithm  . . . . . . . . . . . . . . . . . . .  10
       2.1.2.  ID Context  . . . . . . . . . . . . . . . . . . . . .   9
       2.1.2.  Counter  10
       2.1.3.  Group Manager Public Key  . . . . . . . . . . . . . .  10
       2.1.4.  Signature Encryption Algorithm  . . . . . . . . . . .  10
       2.1.5.  Signature Algorithm . . . . .   9
       2.1.3.  Counter Signature Parameters . . . . . . . . . . . .   9
       2.1.4.  Secret Derivation Algorithm  11
       2.1.6.  Group Encryption Key  . . . . . . . . . . . . . .  10
       2.1.5.  Secret Derivation Parameters . .  11
       2.1.7.  Pairwise Key Agreement Algorithm  . . . . . . . . . .  11
     2.2.  Sender Context and Recipient Context  . . . . . . . . . .  11  12
     2.3.  Format of Public Keys . . . . . . . . . . . . . . . . . .  13
     2.4.  Pairwise Keys . . . . . . . . . . . . . . . . . . . . . .  12
       2.3.1.  14
       2.4.1.  Derivation of Pairwise Keys . . . . . . . . . . . . .  12
       2.3.2.  14
       2.4.2.  ECDH with Montgomery Coordinates  . . . . . . . . . .  16
       2.4.3.  Usage of Sequence Numbers . . . . . . . . . . . . . .  13
       2.3.3.  17
       2.4.4.  Security Context for Pairwise Mode  . . . . . . . . .  14
     2.4.  17
     2.5.  Update of Security Context  . . . . . . . . . . . . . . .  14
       2.4.1.  18
       2.5.1.  Loss of Mutable Security Context  . . . . . . . . . .  15
       2.4.2.  18
       2.5.2.  Exhaustion of Sender Sequence Number  . . . . . . . .  16
       2.4.3.  19
       2.5.3.  Retrieving New Security Context Parameters  . . . . .  17  20
   3.  The Group Manager . . . . . . . . . . . . . . . . . . . . . .  19  22
     3.1.  Management of Group Keying Material  Support for Additional Principals . . . . . . . . . . .  20 .  24
     3.2.  Responsibilities  Management of the Group Manager Keying Material . . . . . . . . . .  21
   4.  The COSE Object .  24
       3.2.1.  Recycling of Identifiers  . . . . . . . . . . . . . .  27
     3.3.  Responsibilities of the Group Manager . . . . . . . .  23
     4.1.  Counter Signature . .  28
   4.  The COSE Object . . . . . . . . . . . . . . . . . .  23
     4.2.  The 'kid' and 'kid context' parameters . . . . .  30
     4.1.  Countersignature  . . . .  23
     4.3.  external_aad . . . . . . . . . . . . . . . .  30
       4.1.1.  Keystream Derivation  . . . . . .  23
   5.  OSCORE Header Compression . . . . . . . . . .  30
       4.1.2.  Clarifications on Using a Countersignature  . . . . .  32
     4.2.  The 'kid' and 'kid context' parameters  . . .  25 . . . . . .  32
     4.3.  external_aad  . . . . . . . . . . . . . . . . . . . . . .  32
   5.  OSCORE Header Compression . . . . . . . . . . . . . . . . . .  35
     5.1.  Examples of Compressed COSE Objects . . . . . . . . . . .  26  36
       5.1.1.  Examples in Group Mode  . . . . . . . . . . . . . . .  26  36
       5.1.2.  Examples in Pairwise Mode . . . . . . . . . . . . . .  27  37

   6.  Message Binding, Sequence Numbers, Freshness and Replay
           Protection  . . . . . . . . . . . . . . . . . . . . . . .  38
     6.1.  Supporting Observe  . .  28
     6.1. . . . . . . . . . . . . . . . . .  38
     6.2.  Update of Replay Window . . . . . . . . . . . . . . . . .  28
     6.2.  38
     6.3.  Message Freshness . . . . . . . . . . . . . . . . . . . .  29  39
   7.  Message Reception . . . . . . . . . . . . . . . . . . . . . .  29  39
   8.  Message Processing in Group Mode  . . . . . . . . . . . . . .  30  40
     8.1.  Protecting the Request  . . . . . . . . . . . . . . . . .  31  41
       8.1.1.  Supporting Observe  . . . . . . . . . . . . . . . . .  31  42
     8.2.  Verifying the Request . . . . . . . . . . . . . . . . . .  32  43
       8.2.1.  Supporting Observe  . . . . . . . . . . . . . . . . .  34  44
     8.3.  Protecting the Response . . . . . . . . . . . . . . . . .  34  45
       8.3.1.  Supporting Observe  . . . . . . . . . . . . . . . . .  35  46
     8.4.  Verifying the Response  . . . . . . . . . . . . . . . . .  35  46
       8.4.1.  Supporting Observe  . . . . . . . . . . . . . . . . .  36  48
     8.5.  External Signature Checkers . . . . . . . . . . . . . . .  50
   9.  Message Processing in Pairwise Mode . . . . . . . . . . . . .  37  51
     9.1.  Pre-Conditions  . . . . . . . . . . . . . . . . . . . . .  38  52
     9.2.  Main Differences from OSCORE  . . . . . . . . . . . . . .  38  52
     9.3.  Protecting the Request  . . . . . . . . . . . . . . . . .  39  52
     9.4.  Verifying the Request . . . . . . . . . . . . . . . . . .  39  53
     9.5.  Protecting the Response . . . . . . . . . . . . . . . . .  39  53
     9.6.  Verifying the Response  . . . . . . . . . . . . . . . . .  40  54
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  40  55
     10.1.  Group-level  Security of the Group Mode . . . . . . . . . . . . . . .  56
     10.2.  Security of the Pairwise Mode  . . . . . . . . .  41
     10.2. . . . .  57
     10.3.  Uniqueness of (key, nonce) . . . . . . . . . . . . . . .  42
     10.3.  58
     10.4.  Management of Group Keying Material  . . . . . . . . . .  42
     10.4.  58
     10.5.  Update of Security Context and Key Rotation  . . . . . .  43
       10.4.1.  59
       10.5.1.  Late Update on the Sender  . . . . . . . . . . . . .  43
       10.4.2.  59
       10.5.2.  Late Update on the Recipient . . . . . . . . . . . .  44
     10.5.  60
     10.6.  Collision of Group Identifiers . . . . . . . . . . . . .  44
     10.6.  60
     10.7.  Cross-group Message Injection  . . . . . . . . . . . . .  45
       10.6.1.  61
       10.7.1.  Attack Description . . . . . . . . . . . . . . . . .  45
       10.6.2.  61
       10.7.2.  Attack Prevention in Group Mode  . . . . . . . . . .  46
     10.7.  62
     10.8.  Prevention of Group Cloning Attack . . . . . . . . . . .  63
     10.9.  Group OSCORE for Unicast Requests  . . . . . . . . . . .  47
     10.8.  63
     10.10. End-to-end Protection  . . . . . . . . . . . . . . . . .  48
     10.9.  65
     10.11. Master Secret  . . . . . . . . . . . . . . . . . . . . .  48
     10.10.  65
     10.12. Replay Protection  . . . . . . . . . . . . . . . . . . .  49
     10.11.  65
     10.13. Message Freshness  . . . . . . . . . . . . . . . . . . .  49
     10.12.  66
     10.14. Client Aliveness . . . . . . . . . . . . . . . . . . . .  50
     10.13.  66
     10.15. Cryptographic Considerations . . . . . . . . . . . . . .  50
     10.14.  66
     10.16. Message Segmentation . . . . . . . . . . . . . . . . . .  51
     10.15.  69
     10.17. Privacy Considerations . . . . . . . . . . . . . . . . .  51  69
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  52  70
     11.1.  OSCORE Flag Bits Registry  . . . . . . . . . . . . . . .  52  70
   12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  52  70
     12.1.  Normative References . . . . . . . . . . . . . . . . . .  52  70
     12.2.  Informative References . . . . . . . . . . . . . . . . .  54  72
   Appendix A.  Assumptions and Security Objectives  . . . . . . . .  56  76
     A.1.  Assumptions . . . . . . . . . . . . . . . . . . . . . . .  57  76
     A.2.  Security Objectives . . . . . . . . . . . . . . . . . . .  58  78
   Appendix B.  List of Use Cases  . . . . . . . . . . . . . . . . .  59  79
   Appendix C.  Example of Group Identifier Format . . . . . . . . .  61  81
   Appendix D.  Set-up of New Endpoints  . . . . . . . . . . . . . .  62  82
   Appendix E.  Challenge-Response Synchronization . . . . . . . . .  63  83
   Appendix F.  No Verification of Signatures in Group Mode  . . . .  66
   Appendix G.  Example Values with COSE Capabilities  . . . . . . .  67
   Appendix H.  Parameter Extensibility for Future COSE Algorithms .  68
     H.1.  Counter Signature Parameters  . . . . . . . . . . . . . .  68
     H.2.  Secret Derivation Parameters  . . . . .  Document Updates . . . . . . . . .  69
     H.3.  'par_countersign' in the external_aad . . . . . . . . .  86
     F.1.  Version -11 to -12  .  69
   Appendix I.  Document Updates . . . . . . . . . . . . . . . . . .  71
     I.1.  86
     F.2.  Version -10 to -11  . . . . . . . . . . . . . . . . . . .  71
     I.2.  87
     F.3.  Version -09 to -10  . . . . . . . . . . . . . . . . . . .  72
     I.3.  88
     F.4.  Version -08 to -09  . . . . . . . . . . . . . . . . . . .  72
     I.4.  89
     F.5.  Version -07 to -08  . . . . . . . . . . . . . . . . . . .  73
     I.5.  90
     F.6.  Version -06 to -07  . . . . . . . . . . . . . . . . . . .  75
     I.6.  91
     F.7.  Version -05 to -06  . . . . . . . . . . . . . . . . . . .  75
     I.7.  92
     F.8.  Version -04 to -05  . . . . . . . . . . . . . . . . . . .  76
     I.8.  92
     F.9.  Version -03 to -04  . . . . . . . . . . . . . . . . . . .  76
     I.9.  93
     F.10. Version -02 to -03  . . . . . . . . . . . . . . . . . . .  77
     I.10.  93
     F.11. Version -01 to -02  . . . . . . . . . . . . . . . . . . .  78
     I.11.  94
     F.12. Version -00 to -01  . . . . . . . . . . . . . . . . . . .  79  95
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  79  96
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  80  96

1.  Introduction

   The Constrained Application Protocol (CoAP) [RFC7252] is a web
   transfer protocol specifically designed for constrained devices and
   networks [RFC7228].  Group communication for CoAP
   [I-D.ietf-core-groupcomm-bis] addresses use cases where deployed
   devices benefit from a group communication model, for example to
   reduce latencies, improve performance performance, and reduce bandwidth
   utilization.  Use cases include lighting control, integrated building
   control, software and firmware updates, parameter and configuration
   updates, commissioning of constrained networks, and emergency
   multicast (see Appendix B).  This specification defines the security
   protocol for  Group communication for CoAP
   [I-D.ietf-core-groupcomm-bis].
   [I-D.ietf-core-groupcomm-bis] mainly uses UDP/IP multicast as the
   underlying data transport.

   Object Security for Constrained RESTful Environments (OSCORE)
   [RFC8613] describes a security protocol based on the exchange of
   protected CoAP messages.  OSCORE builds on CBOR Object Signing and
   Encryption (COSE)
   [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and
   provides end-to-end encryption, integrity, replay protection and
   binding of response to request between a sender and a recipient,
   independent of the transport layer also in the presence of
   intermediaries.  To this end, a CoAP message is protected by
   including its payload (if any), certain options, and header fields in
   a COSE object, which replaces the authenticated and encrypted fields
   in the protected message.

   This document defines Group OSCORE, a security protocol for Group
   communication for CoAP [I-D.ietf-core-groupcomm-bis], providing the
   same end-to-end security properties as OSCORE in the case where CoAP
   requests have multiple recipients.  In particular, the described
   approach defines how OSCORE is used in a group communication setting
   to provide source authentication for CoAP group requests, sent by a
   client to multiple servers, and for protection of the corresponding
   CoAP responses.  Group OSCORE also defines a pairwise mode where each
   member of the group can efficiently derive a symmetric pairwise key
   with any other member of the group for pairwise OSCORE communication.
   Just like OSCORE, Group OSCORE is independent of the transport layer
   and works wherever CoAP does.  Group communication for CoAP
   [I-D.ietf-core-groupcomm-bis] uses UDP/IP multicast as the underlying
   data transport.

   As with OSCORE, it is possible to combine Group OSCORE with
   communication security on other layers.  One example is the use of
   transport layer security, such as DTLS
   [RFC6347][I-D.ietf-tls-dtls13], between one client and one proxy (and
   vice versa), or between one proxy and one server (and vice versa), in
   order to protect the routing information of packets from observers.
   Note that DTLS does not define how to secure messages sent over IP
   multicast.

   Group OSCORE defines two modes of operation:

   o operation, that can be used
   independently or together:

   *  In the group mode, Group OSCORE requests and responses are
      digitally signed with the private key of the sender and the
      signature is embedded in the protected CoAP message.  The group
      mode supports all COSE signature algorithms as well as signature
      verification by intermediaries.  This mode is defined in
      Section 8
      and MUST be supported.

   o 8.

   *  In the pairwise mode, two group members exchange Group OSCORE requests
      and responses (typically) over unicast, and the messages are
      protected with symmetric keys.  These symmetric keys are derived
      from Diffie-Hellman shared secrets, calculated with the asymmetric
      keys of the sender and recipient, allowing for shorter integrity
      tags and therefore lower message overhead.  This mode is defined
      in Section 9 and is OPTIONAL to support. 9.

   Both modes provide source authentication of CoAP messages.  The
   application decides what mode to use, potentially on a per-message
   basis.  Such decisions can be based, for instance, on pre-configured
   policies or dynamic assessing of the target recipient and/or
   resource, among other things.  One important case is when requests
   are protected with the group mode, and responses with the pairwise
   mode.  Since such responses convey shorter integrity tags instead of
   bigger, full-fledged signatures, this significantly reduces the
   message overhead in case of many responses to one request.

   A special deployment of Group OSCORE is to use pairwise mode only.
   For example, consider the case of a constrained-node network
   [RFC7228] with a large number of CoAP endpoints and the objective to
   establish secure communication between any pair of endpoints with a
   small provisioning effort and message overhead.  Since the total
   number of security associations that needs to be established grows
   with the square of the number of nodes, it is desirable to restrict
   the provisioned keying material.  Moreover, a key establishment
   protocol would need to be executed for each security association.
   One solution to this is to deploy Group OSCORE, with the endpoints
   being part of a group, and use the pairwise mode.  This solution
   assumes a trusted third party called Group Manager (see Section 3),
   but has the benefit of restricting the symmetric keying material
   while distributing only the public key of each group member.  After
   that, a CoAP endpoint can locally derive the OSCORE Security Context
   for the other endpoint in the group, and protect CoAP communications
   with very low overhead [I-D.ietf-lwig-security-protocol-comparison].

1.1.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

   Readers are expected to be familiar with the terms and concepts
   described in CoAP [RFC7252] including "endpoint", "client", "server",
   "sender" and "recipient"; group communication for CoAP
   [I-D.ietf-core-groupcomm-bis]; CBOR [RFC8949]; COSE
   [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] and
   related counter signatures countersignatures [I-D.ietf-cose-countersign].

   Readers are also expected to be familiar with the terms and concepts
   for protection and processing of CoAP messages through OSCORE, such
   as "Security Context" and "Master Secret", defined in [RFC8613].

   Terminology for constrained environments, such as "constrained
   device" and "constrained-node network", is defined in [RFC7228].

   This document refers also to the following terminology.

   o

   *  Keying material: data that is necessary to establish and maintain
      secure communication among endpoints.  This includes, for
      instance, keys and IVs [RFC4949].

   o

   *  Group: a set of endpoints that share group keying material and
      security parameters (Common Context, see Section 2).  That is,
      unless otherwise specified, the term group used in this
      specification document
      refers to a "security group" (see Section 2.1 of
      [I-D.ietf-core-groupcomm-bis]), not to be confused with "CoAP
      group" or "application group".

   o

   *  Group Manager: entity responsible for a group.  Each endpoint in a
      group communicates securely with the respective Group Manager,
      which is neither required to be an actual group member nor to take
      part in the group communication.  The full list of
      responsibilities of the Group Manager is provided in Section 3.2.

   o 3.3.

   *  Silent server: member of a group that never sends protected
      responses in reply to requests.  For CoAP group communications,
      requests are normally sent without necessarily expecting a
      response.  A silent server may send unprotected responses, as
      error responses reporting an OSCORE error.  Note that an endpoint
      can implement both a silent server and a client, i.e. i.e., the two
      roles are independent.  An endpoint acting only as a silent server
      performs only Group OSCORE processing on incoming requests.
      Silent servers maintain less keying material and in particular do
      not have a Sender Context for the group.  Since silent servers do
      not have a Sender ID, they cannot support the pairwise mode.

   o

   *  Group Identifier (Gid): identifier assigned to the group, unique
      within the set of groups of a given Group Manager.

   o

   *  Birth Gid: with respect to a group member, the Gid obtained by
      that group member upon (re-)joining the group.

   *  Group request: CoAP request message sent by a client in the group
      to all servers in that group.

   o

   *  Key Generation Number: an integer value identifying the current
      version of the keying material used in a group.

   *  Source authentication: evidence that a received message in the
      group originated from a specific identified group member.  This
      also provides assurance that the message was not tampered with by
      anyone, be it a different legitimate group member or an endpoint
      which is not a group member.

2.  Security Context

   This specification document refers to a group as a set of endpoints sharing keying
   material and security parameters for executing the Group OSCORE
   protocol (see Section 1.1).  Each  Regardless of what it actually supports,
   each endpoint which of a group is member aware of whether the group uses the group
   mode, or the pairwise mode, or both.

   All members of a group maintains maintain a Security Context as defined in
   Section 3 of
   [RFC8613], [RFC8613] and extended as follows (see Figure 1):

   o  One Common defined in this section.  How
   the Security Context is established by the group members is out of
   scope for this document, but if there is more than one Security
   Context applicable to a message, then the endpoints MUST be able to
   tell which Security Context was latest established.

   The default setting for how to manage information about the group,
   including the Security Context, is described in terms of a Group
   Manager (see Section 3).  In particular, the Group Manager indicates
   whether the group uses the group mode, the pairwise mode, or both of
   them, as part of the group data provided to candidate group members
   when joining the group.

   The remainder of this section provides further details about the
   Security Context of Group OSCORE.  In particular, each endpoint which
   is member of a group maintains a Security Context as defined in
   Section 3 of [RFC8613], extended as follows (see Figure 1).

   *  One Common Context, shared by all the endpoints in the group.  Two
      Several new parameters are included in the Common Context, namely Counter Context.

      If a Group Manager is used for maintaining the group, the Common
      Context is extended with the public key of the Group Manager.
      When processing a message, the public key of the Group Manager is
      included in the external additional authenticated data.

      If the group uses the group mode, the Common context is extended
      with the following new parameters.

      -  Signature Encryption Algorithm and Counter Signature Parameters. Algorithm.  These
         relate to the computation encryption/decryption operations and to the
         computation/verification of counter signatures, countersignatures, respectively,
         when messages are a message is protected using with the group mode (see
         Section 8).

      If

      -  Group Encryption Key, used to perform encryption/decryption of
         countersignatures, when a message is protected with the pairwise group
         mode is supported, (see Section 8).

      If the Common group uses the pairwise mode, the Common Context is further
      extended with two new parameters, namely Secret Derivation a Pairwise Key Agreement Algorithm and Secret Derivation Parameters.  These relate to the
      derivation of used for
      agreement on a static-static Diffie-Hellman shared secret, from
      which pairwise keys are derived (see Section 2.3.1) 2.4.1) to protect
      messages with the pairwise mode (see Section 9).

   o

   *  One Sender Context, extended with the endpoint's public and
      private key. key pair.  The private key is used to sign the message messages in
      group mode, and or for deriving the pairwise keys in pairwise mode (see
      Section 2.3). 2.4).  When processing a message, the public key is
      included in the external additional authenticated data.

      If the endpoint supports the pairwise mode is supported, mode, the Sender Context is
      also extended with the Pairwise Sender Keys associated to the
      other endpoints (see Section 2.3). 2.4).

      The Sender Context is omitted if the endpoint is configured
      exclusively as silent server.

   o

   *  One Recipient Context for each endpoint from which messages are
      received.  It is not necessary to maintain Recipient Contexts
      associated to endpoints from which messages are not (expected to
      be) received.  The Recipient Context is extended with the public
      key of the associated endpoint, used to verify the signature in
      group mode and for deriving the pairwise keys in pairwise mode
      (see Section 2.3). 2.4).  If the endpoint supports the pairwise mode is supported, mode,
      then the Recipient Context is also extended with the Pairwise
      Recipient Key associated to the other endpoint (see Section 2.3).

   +-------------------+-----------------------------------------------+ 2.4).

  +-------------------+------------------------------------------------+
  | Context Component | New Information Elements                       |
   +-------------------+-----------------------------------------------+
  +-------------------+------------------------------------------------+
  | Common Context    | Counter   Group Manager Public Key                     |
  |                   | * Signature Encryption Algorithm               |
  |                   | Counter * Signature Parameters Algorithm                          |
  |                   | *Secret Derivation Algorithm * Group Encryption Key                         |
  |                   | *Secret Derivation Parameters ^ Pairwise Key Agreement Algorithm             |
   +-------------------+-----------------------------------------------+
  +-------------------+------------------------------------------------+
  | Sender Context    |   Endpoint's own public and private key pair   |
  |                   | *Pairwise ^ Pairwise Sender Keys for the other endpoints |
   +-------------------+-----------------------------------------------+
  +-------------------+------------------------------------------------+
  | Each              |   Public key of the other endpoint             |
  | Recipient Context | *Pairwise ^ Pairwise Recipient Key of the other endpoint |
   +-------------------+-----------------------------------------------+
  +-------------------+------------------------------------------------+

    Figure 1: Additions to the OSCORE Security Context.  Optional
                  additions are  The optional
      elements labeled with an asterisk.

   Further details about the Security Context of Group OSCORE * (with ^) are
   provided in the remainder of this section.  How the Security Context
   is established by the group members is out of scope for this
   specification, but present only if there is more than one Security Context
   applicable to a message, then the endpoints MUST be able to tell
   which Security Context was latest established.

   The default setting for how to manage information about group
                 uses the group is
   described in terms of a Group Manager (see Section 3). mode (the pairwise mode).

2.1.  Common Context

   The Common Context may be acquired from the Group Manager (see
   Section 3).  The following sections define how the Common Context is
   extended, compared to [RFC8613].

2.1.1.  ID Context

   The ID Context parameter  AEAD Algorithm

   AEAD Algorithm identifies the COSE AEAD algorithm to use for
   encryption, when messages are protected using the pairwise mode (see Sections 3.3 and 5.1 of [RFC8613]) in
   Section 9).  This algorithm MUST provide integrity protection.  This
   parameter is immutable once the Common Context SHALL contain the is established, and it
   is not relevant if the group uses only the group mode.

   For endpoints that support the pairwise mode, the AEAD algorithm AES-
   CCM-16-64-128 defined in Section 4.2 of
   [I-D.ietf-cose-rfc8152bis-algs] is mandatory to implement.

2.1.2.  ID Context

   The ID Context parameter (see Sections 3.1 and 3.3 of [RFC8613]) in
   the Common Context SHALL contain the Group Identifier (Gid) of the
   group.  The choice of the Gid format is application specific.  An
   example of specific formatting of the Gid is given in Appendix C.
   The application needs to specify how to handle potential collisions
   between Gids (see Section 10.5).

2.1.2.  Counter 10.6).

2.1.3.  Group Manager Public Key

   Group Manager Public Key specifies the public key of the Group
   Manager.  This is included in the external additional authenticated
   data (see Section 4.3).

   Each group member MUST obtain the public key of the Group Manager
   with a valid proof-of-possession of the corresponding private key,
   for instance from the Group Manager itself when joining the group.
   Further details on the provisioning of the Group Manager's public key
   to the group members are out of the scope of this document.

2.1.4.  Signature Encryption Algorithm

   Signature Encryption Algorithm identifies the algorithm to use for
   enryption, when messages are protected using the group mode (see
   Section 8).  This algorithm MAY provide integrity protection.  This
   parameter is immutable once the Common Context is established.

   For endpoints that support the group mode and use authenticated
   encryption, the AEAD algorithm AES-CCM-16-64-128 defined in
   Section 4.2 of [I-D.ietf-cose-rfc8152bis-algs] is mandatory to
   implement.

2.1.5.  Signature Algorithm

   Counter

   Signature Algorithm identifies the digital signature algorithm used
   to compute a counter signature countersignature on the COSE object (see Sections 3.2
   and 3.3 of [I-D.ietf-cose-countersign]), when messages are protected
   using the group mode (see Section 8).  This parameter is immutable
   once the Common Context is established.
   Counter Signature Algorithm MUST take value from the "Value" column
   of the "COSE Algorithms" Registry [COSE.Algorithms].  The value is
   associated to a COSE key type, as specified in

   For endpoints that support the "Capabilities"
   column of group mode, the "COSE Algorithms" Registry [COSE.Algorithms].  COSE
   capabilities for algorithms are defined in Section 8 of
   [I-D.ietf-cose-rfc8152bis-algs].

   The EdDSA signature
   algorithm and the elliptic curve Ed25519 [RFC8032] are mandatory to
   implement.  If elliptic curve signatures are used, it is RECOMMENDED
   to implement deterministic signatures with additional randomness as
   specified in [I-D.mattsson-cfrg-det-sigs-with-noise].

2.1.3.  Counter Signature Parameters

   Counter Signature Parameters identifies

2.1.6.  Group Encryption Key

   Group Encryption Key specifies the parameters associated encryption key for deriving a
   keystream to
   the digital signature algorithm specified in Counter Signature
   Algorithm.  This parameter encrypt/decrypt a countersignature, when a message is immutable once
   protected with the Common Context is
   established.

   This parameter group mode (see Section 8).

   The Group Encryption Key is a CBOR array including derived as defined for Sender/Recipient
   Keys in Section 3.2.1 of [RFC8613], with the following two elements,
   whose exact structure and value depend on the value of Counter
   Signature Algorithm:

   o differences.

   *  The first 'alg_aead' element is of the 'info' array of COSE capabilities for Counter
      Signature Algorithm, as specified for that algorithm in takes the
      "Capabilities" column value of
      Signature Encryption Algorithm from the "COSE Algorithms" Registry
      [COSE.Algorithms] Common Context (see
      Section 8.1 of
      [I-D.ietf-cose-rfc8152bis-algs]).

   o 2.1.5).

   *  The second 'type' element is of the 'info' array is "Group Encryption Key".
      The label is an ASCII string and does not include a trailing NUL
      byte.

   *  L and the 'L' element of COSE capabilities for the COSE
      key type associated to Counter Signature Algorithm, as specified
      for that key type in 'info' array are the "Capabilities" column size of the "COSE Key
      Types" Registry [COSE.Key.Types]
      output of the HKDF Algorithm from the Common Context (see
      Section 8.2 of
      [I-D.ietf-cose-rfc8152bis-algs]).

   Examples 3.2 of Counter Signature Parameters are in Appendix G.

   This format is consistent with every counter signature algorithm
   currently considered [RFC8613]), in [I-D.ietf-cose-rfc8152bis-algs], i.e. with
   algorithms that have only the COSE key type as their COSE capability.
   Appendix H describes how Counter Signature Parameters can be
   generalized for possible future registered algorithms having a
   different set of COSE capabilities.

2.1.4.  Secret Derivation bytes.

2.1.7.  Pairwise Key Agreement Algorithm

   Secret Derivation

   Pairwise Key Agreement Algorithm identifies the elliptic curve Diffie-
   Hellman
   Diffie-Hellman algorithm used to derive a static-static Diffie-Hellman Diffie-
   Hellman shared secret, from which pairwise keys are derived (see
   Section 2.3.1) 2.4.1) to protect messages with the pairwise mode (see
   Section 9).  This parameter is immutable once the Common Context is
   established.
   Secret Derivation Algorithm MUST take value from

   For endpoints that support the "Value" column
   of the "COSE Algorithms" Registry [COSE.Algorithms].  The value is
   associated to a COSE key type, as specified in the "Capabilities"
   column of the "COSE Algorithms" Registry [COSE.Algorithms].  COSE
   capabilities for algorithms are defined in Section 8 of
   [I-D.ietf-cose-rfc8152bis-algs].

   For endpoints that support the pairwise mode, pairwise mode, the ECDH-SS + HKDF-256
   algorithm specified in Section 6.3.1 of
   [I-D.ietf-cose-rfc8152bis-algs] and the X25519 curve [RFC7748] are
   mandatory to implement.

2.1.5.  Secret Derivation Parameters

   Secret Derivation Parameters identifies the parameters associated to
   the elliptic curve Diffie-Hellman algorithm specified in Secret
   Derivation Algorithm.  This parameter is immutable once the Common
   Context is established.

   This parameter is a CBOR array including the following two elements,
   whose exact structure and value depend on the value of Secret
   Derivation Algorithm:

   o  The first element is the array of COSE capabilities for Secret
      Derivation Algorithm, as specified for that algorithm in the
      "Capabilities" column of the "COSE Algorithms" Registry
      [COSE.Algorithms] (see Section 8.1 of
      [I-D.ietf-cose-rfc8152bis-algs]).

   o  The second element is the array of COSE capabilities for the COSE
      key type associated to Secret Derivation Algorithm, as specified
      for that key type in the "Capabilities" column of the "COSE Key
      Types" Registry [COSE.Key.Types] (see Section 8.2 of
      [I-D.ietf-cose-rfc8152bis-algs]).

   Examples of Secret Derivation Parameters are in Appendix G.

   This format is consistent with every elliptic curve Diffie-Hellman
   algorithm currently considered in [I-D.ietf-cose-rfc8152bis-algs],
   i.e. with algorithms that have only the COSE key type as their COSE
   capability.  Appendix H describes how Secret Derivation Parameters
   can be generalized for possible future registered algorithms having a
   different set of COSE capabilities.

2.2.  Sender Context and Recipient Context

   OSCORE specifies the derivation of Sender Context and Recipient
   Context, specifically of Sender/Recipient Keys and Common IV, from a
   set of input parameters (see Section 3.2 of [RFC8613]).  This  Like in
   [RFC8613], HKDF SHA-256 is the mandatory to implement HKDF.

   The derivation of Sender/Recipient Keys and Common IV defined in
   OSCORE applies also to Group OSCORE, and the mandatory-to-
   implement HKDF and AEAD algorithms are with the same as in following extensions
   compared to Section 3.2.1 of [RFC8613].  The
   Sender ID SHALL be

   *  If the group uses (also) the group mode, the 'alg_aead' element of
      the 'info' array takes the value of Signature Encryption Algorithm
      from the Common Context (see Section 2.1.5).

   *  If the group uses only the pairwise mode, the 'alg_aead' element
      of the 'info' array takes the value of AEAD Algorithm from the
      Common Context (see Section 2.1.1).

   The Sender ID SHALL be unique for each endpoint in a group with a fixed
   Master
   certain tuple (Master Secret, Master Salt and Salt, Group Identifier (see Identifier), see
   Section 3.3 of
   [RFC8613]). [RFC8613].

   For Group OSCORE, the Sender Context and Recipient Context
   additionally contain asymmetric keys, as described previously in
   Section 2.  The private/public key pair of the sender can, for
   example, be generated by the endpoint or provisioned during
   manufacturing.

   With the exception of the public key of the sender endpoint and the
   possibly associated pairwise keys, a receiver endpoint can derive a
   complete Security Context from a received Group OSCORE message and
   the Common Context.  The public keys in the Recipient Contexts can be
   retrieved from the Group Manager (see Section 3) upon joining the
   group.  A public key can alternatively be acquired from the Group
   Manager at a later time, for example the first time a message is
   received from a particular endpoint in the group (see Section 8.2 and
   Section 8.4).

   For severely constrained devices, it may be not feasible to
   simultaneously handle the ongoing processing of a recently received
   message in parallel with the retrieval of the sender endpoint's
   public key.  Such devices can be configured to drop a received
   message for which there is no (complete) Recipient Context, and
   retrieve the sender endpoint's public key in order to have it
   available to verify subsequent messages from that endpoint.

   An endpoint admits a maximum amount of Recipient Contexts for a same
   Security Context, e.g. e.g., due to memory limitations.  After reaching
   that limit, the creation of a new Recipient Context results in an
   overflow.  When this happens, the endpoint has to delete a current
   Recipient Context to install the new one.  It is up to the
   application to define policies for selecting the current Recipient
   Context to delete.  A newly installed Recipient Context that has
   required to delete another Recipient Context is initialized with an
   invalid Replay Window, and accordingly requires the endpoint to take
   appropriate actions (see Section 2.4.1.2). 2.5.1.2).

2.3.  Pairwise  Format of Public Keys

   Certain signature schemes, such as EdDSA and ECDSA, support

   In a secure
   combined signature and encryption scheme.  This section specifies group, the
   derivation following MUST hold for the public key of "pairwise keys", each
   endpoint as well as for use in the pairwise mode defined
   in Section 9.

2.3.1.  Derivation public key of Pairwise Keys

   Using the Group OSCORE Security Context (see Section 2), a group
   member can derive AEAD Manager.

   *  All public keys MUST be encoded according to protect point-to-point communication
   between itself and any other endpoint in the group.  The same AEAD
   algorithm as format used
      in the group mode is used. group.  The key derivation of these
   so-called pairwise keys follows format MUST provide the same construction as in
   Section 3.2.1 full set of [RFC8613]:

   Pairwise Sender Key    = HKDF(Sender Key, Shared Secret, info, L)
   Pairwise Recipient Key = HKDF(Recipient Key, Shared Secret, info, L)
   where:

   o  The Pairwise Sender Key is the AEAD key for processing outgoing
      messages addressed information
      related to endpoint X.

   o  The Pairwise Recipient Key is the AEAD public key algorithm, including, e.g., the used
      elliptic curve (when applicable).

   *  All public keys MUST be for processing incoming
      messages from endpoint X.

   o  HKDF is the HKDF public key algorithm specified by Secret Derivation
      Algorithm from used in the Common Context (see Section 2.1.4).

   o  The Sender Key
      group and private key are from aligned with the Sender Context.  The
      Sender Key is possible associated parameters used as salt in
      the HKDF, when deriving group, e.g., the Pairwise
      Sender Key.

   o  The Recipient Key and used elliptic curve (when applicable).

   If the group uses (also) the group mode, the public key are from the Recipient
      Context associated to endpoint X.  The Recipient Key algorithm is
   the Signature Algorithm used as
      salt in the HKDF, when deriving the Pairwise Recipient Key.

   o  The Shared Secret is computed as a static-static Diffie-Hellman
      shared secret [NIST-800-56A], where group.  If the endpoint group uses its private
      key and only
   the pairwise mode, the public key of the other endpoint X.  The Shared Secret algorithm is the Pairwise Key
   Agreement Algorithm used as Input Keying Material (IKM) in the HKDF.

   o  info and L group.

   If CWTs [RFC8392] or unprotected CWT claim sets [I-D.ietf-rats-uccs]
   are used as defined in Section 3.2.1 of [RFC8613]. public key format, the public key algorithm is fully
   described by a COSE key type and its "kty" and "crv" parameters.

   If EdDSA asymmetric keys X.509 certificates [RFC7925] or C509 certificates
   [I-D.ietf-cose-cbor-encoded-cert] are used, used as public key format, the Edward coordinates are mapped
   to Montgomery coordinates using
   public key algorithm is fully described by the maps defined in Sections 4.1 and
   4.2 "algorithm" field of [RFC7748], before using
   the X25519 and X448 functions defined
   in Section 5 of [RFC7748].

   After establishing a partially or completely new Security Context
   (see Section 2.4 "SubjectPublicKeyInfo" structure, and Section 3.1), by the old
   "subjectPublicKeyAlgorithm" element, respectively.

   Public keys are also used to derive pairwise keys MUST be
   deleted.  Since new Sender/Recipient Keys (see Section 2.4.1)
   and are derived from included in the new
   group keying material external additional authenticated data (see
   Section 2.2), every 4.3).  In both of these cases, an endpoint in a group member MUST use
   the new Sender/Recipient Keys when deriving new pairwise keys.

   As long
   treat public keys as any two group members preserve opaque data, i.e., by considering the same asymmetric keys,
   their Diffie-Hellman shared secret does not change across updates of
   binary representation made available to other endpoints in the group keying material.

2.3.2.  Usage group,
   possibly through a designated trusted source (e.g., the Group
   Manager).

   For example, an X.509 certificate is provided as its direct binary
   serialization.  If C509 certificates or CWTs are used as credential
   format, they are provided as the binary serialization of Sequence Numbers

   When using any a (possibly
   tagged) CBOR array.  If a CWT claim set is used as credential format,
   it is provided as the binary serialization of its a CBOR map.

2.4.  Pairwise Sender Keys, Keys

   Certain signature schemes, such as EdDSA and ECDSA, support a sender endpoint
   including secure
   combined signature and encryption scheme.  This section specifies the 'Partial IV' parameter
   derivation of "pairwise keys", for use in the protected message pairwise mode defined
   in Section 9.  Group OSCORE keys used for both signature and
   encryption MUST
   use NOT be used for any other purposes than Group OSCORE.

2.4.1.  Derivation of Pairwise Keys

   Using the current fresh value Group OSCORE Security Context (see Section 2), a group
   member can derive AEAD keys, to protect point-to-point communication
   between itself and any other endpoint in the group by means of the Sender Sequence Number
   AEAD Algorithm from its
   Sender the Common Context (see Section 2.2).  That is, 2.1.1).  The key
   derivation of these so-called pairwise keys follows the same
   construction as in Section 3.2.1 of [RFC8613]:

   Pairwise Sender Sequence
   Number space is used for all outgoing messages protected with Group
   OSCORE, thus limiting both storage and complexity.

   On the other hand, when combining group and pairwise communication
   modes, this may result in the Partial IV values moving forward more
   often.  This can happen when a client engages in frequent or long
   sequences of one-to-one exchanges Key    = HKDF(Sender Key, IKM-Sender, info, L)
   Pairwise Recipient Key = HKDF(Recipient Key, IKM-Recipient, info, L)

   with servers in

   IKM-Sender    = Sender Pub Key | Recipient Pub Key | Shared Secret
   IKM-Recipient = Recipient Pub Key | Sender Pub Key | Shared Secret

   where:

   *  The Pairwise Sender Key is the group, by
   sending requests over unicast.

2.3.3.  Security Context AEAD key for processing outgoing
      messages addressed to endpoint X.

   *  The Pairwise Mode

   If Recipient Key is the pairwise mode AEAD key for processing incoming
      messages from endpoint X.

   *  HKDF is supported, the Security Context additionally
   includes Secret Derivation Algorithm, Secret Derivation Parameters
   and OSCORE HKDF algorithm [RFC8613] from the pairwise keys, Common
      Context.

   *  The Sender Key from the Sender Context is used as described at salt in the beginning of Section 2.
      HKDF, when deriving the Pairwise Sender Key.

   *  The pairwise keys as well as Recipient Key from the shared secrets Recipient Context associated to
      endpoint X is used as salt in their
   derivation (see Section 2.3.1) may be stored in memory or recomputed
   every time they are needed.  The shared secret changes only the HKDF, when a
   public/private key pair deriving the Pairwise
      Recipient Key.

   *  IKM-Sender is the Input Keying Material (IKM) used for its derivation changes, which
   results in the pairwise keys also changing.  Additionally, HKDF for
      the
   pairwise keys change if derivation of the Pairwise Sender ID changes or if a new Security
   Context Key. IKM-Sender is established for the group (see Section 2.4.3).  In order
   to optimize protocol performance, an byte
      string concatenation of the endpoint's own (signature) public key,
      the endpoint may store X's (signature) public key from the derived
   pairwise Recipient
      Context, and the Shared Secret.  The two (signature) public keys for easy retrieval.

   In
      are binary encoded as defined in Section 2.3.

   *  IKM-Recipient is the pairwise mode, Input Keying Material (IKM) used in the Sender Context includes HKDF
      for the Pairwise derivation of the Recipient Sender
   Keys to use with Key. IKM-Recipient is
      the other endpoints (see Figure 1).  In order to
   identify byte string concatenation of the right endpoint X's (signature)
      public key to use, from the Recipient Context, the endpoint's own
      (signature) public key, and the Shared Secret.  The two
      (signature) public keys are binary encoded as defined in
      Section 2.3.

   *  The Shared Secret is computed as a cofactor Diffie-Hellman shared
      secret, see Section 5.7.1.2 of [NIST-800-56A], using the Pairwise Sender
      Key for Agreement Algorithm.  The endpoint uses its private key from
      the Sender Context and the public key of the other endpoint X
   may be associated to from
      the associated Recipient ID Context.  Note the requirement of endpoint X,
      validation of public keys in Section 10.15.  For X25519 and X448,
      the procedure is described in Section 5 of [RFC7748] using public
      keys mapped to Montgomery coordinates, see Section 2.4.2.

   *  info and L are as defined in Section 3.2.1 of [RFC8613].  That is:

      -  The 'alg_aead' element of the Recipient Context (i.e. 'info' array takes the Sender ID value of
         AEAD Algorithm from the point Common Context (see Section 2.1.1).

      -  L and the 'L' element of view the 'info' array are the size of
   endpoint X).  In this way, the Recipient ID can be used to lookup
         key for the right Pairwise Sender Key. This association may be implemented in
   different ways, e.g. by storing AEAD Algorithm from the pair (Recipient ID, Pairwise
   Sender Key) or linking a Pairwise Sender Key to a Recipient Context.

2.4.  Update of Security Common Context

   It is RECOMMENDED that (see
         Section 2.1.1), in bytes.

   If EdDSA asymmetric keys are used, the immutable part of Edward coordinates are mapped
   to Montgomery coordinates using the Security Context is
   stored maps defined in non-volatile memory, or that it can otherwise be reliably
   accessed throughout the operation Sections 4.1 and
   4.2 of [RFC7748], before using the group, e.g. after a device
   reboots.  However, also immutable parts X25519 and X448 functions defined
   in Section 5 of the Security Context may
   need to be updated, for example due to scheduled key renewal, new [RFC7748].  For further details, see Section 2.4.2.
   ECC asymmetric keys in Montgomery or
   re-joining members Weirstrass form are used
   directly in the group, key agreement algorithm without coordinate mapping.

   After establishing a partially or completely new Security Context
   (see Section 2.5 and Section 3.2), the fact that old pairwise keys MUST be
   deleted.  Since new Sender/Recipient Keys are derived from the endpoint
   changes Sender ID new
   group keying material (see Section 2.4.3).

   On 2.2), every group member MUST use
   the other hand, new Sender/Recipient Keys when deriving new pairwise keys.

   As long as any two group members preserve the mutable parts same asymmetric keys,
   their Diffie-Hellman shared secret does not change across updates of
   the Security Context are
   updated by the endpoint when executing the security protocol, but may
   nevertheless become outdated, e.g. due to loss group keying material.

2.4.2.  ECDH with Montgomery Coordinates

2.4.2.1.  Curve25519

   The y-coordinate of the mutable
   Security Context (see other endpoint's Ed25519 public key is
   decoded as specified in Section 2.4.1) or exhaustion 5.1.3 of Sender Sequence
   Numbers (see Section 2.4.2).

   If it [RFC8032].  The Curve25519
   u-coordinate is not feasible or practically possible to store and maintain
   up-to-date recovered as u = (1 + y) / (1 - y) (mod p) following
   the mutable part map in non-volatile memory (e.g., due to
   limited number Section 4.1 of write operations), [RFC7748].  Note that the endpoint MUST be able mapping is not
   defined for y = 1, and that y = -1 maps to u = 0 which corresponds to
   detect a loss of
   the mutable Security Context neutral group element and thus will result in a degenerate shared
   secret.  Therefore implementations MUST accordingly
   take abort if the actions defined in Section 2.4.1.

2.4.1.  Loss y-coordinate of Mutable Security Context

   An endpoint may lose its mutable Security Context, e.g. due to a
   reboot (see Section 2.4.1.1)
   the other endpoint's Ed25519 public key is 1 or to an overflow of Recipient Contexts
   (see Section 2.4.1.2).

   In such a case, -1 (mod p).

   The private signing key byte strings (= the endpoint needs to prevent lower 32 bytes used for
   generating the re-use public key, see step 1 of a nonce
   with Section 5.1.5 of [RFC8032])
   are decoded the same AEAD key, way for signing in Ed25519 and scalar
   multiplication in X25519.  Hence, to handle incoming replayed messages.

2.4.1.1.  Reboot compute the shared secret the
   endpoint applies the X25519 function to the Ed25519 private signing
   key byte string and Total Loss

   In case a loss of the Sender Context and/or encoded u-coordinate byte string as specified
   in Section 5 of [RFC7748].

2.4.2.2.  Curve448

   The y-coordinate of the Recipient Contexts other endpoint's Ed448 public key is detected (e.g. decoded
   as specified in Section 5.2.3. of [RFC8032].  The Curve448
   u-coordinate is recovered as u = y^2 * (d * y^2 - 1) / (y^2 - 1) (mod
   p) following a reboot), the endpoint MUST NOT protect
   further messages map from "edwards448" in Section 4.2 of [RFC7748],
   and also using this Security Context to avoid reusing an AEAD
   nonce with the same AEAD key.

   In particular, before resuming its operations in relation x^2 = (y^2 - 1)/(d * y^2 - 1) from the group,
   curve equation.  Note that the
   endpoint mapping is not defined for y = 1 or
   -1.  Therefore implementations MUST retrieve new Security Context parameters from abort if the Group
   Manager (see Section 2.4.3) and use them to derive a new Sender
   Context (see Section 2.2).  Since this includes a newly derived
   Sender Key, y-coordinate of the server will not reuse
   peer endpoint's Ed448 public key is 1 or -1 (mod p).

   The private signing key byte strings (= the same pair (key, nonce),
   even when using lower 57 bytes used for
   generating the Partial IV public key, see step 1 of (old re-injected) requests to build Section 5.2.5 of [RFC8032])
   are decoded the AEAD nonce same way for protecting signing in Ed448 and scalar
   multiplication in X448.  Hence, to compute the corresponding responses.

   From then on, shared secret the
   endpoint MUST use applies the latest installed Sender
   Context X448 function to protect outgoing messages.  Also, newly created Recipient
   Contexts will have a Replay Window which is initialized the Ed448 private signing key
   byte string and the encoded u-coordinate byte string as valid.

   If not able to establish an updated Sender Context, e.g. because specified in
   Section 5 of
   lack [RFC7748].

2.4.3.  Usage of connectivity with Sequence Numbers

   When using any of its Pairwise Sender Keys, a sender endpoint
   including the Group Manager, 'Partial IV' parameter in the endpoint protected message MUST NOT
   protect further messages using
   use the current Security Context and MUST
   NOT accept incoming messages from other group members, as currently
   unable to detect possible replays.

2.4.1.2.  Overflow fresh value of Recipient Contexts

   After reaching the maximum amount of Recipient Contexts, an endpoint
   will experience an overflow when installing a new Recipient Context,
   as it requires to first delete an existing one Sender Sequence Number from its
   Sender Context (see Section 2.2).

   Every time this happens, the Replay Window of  That is, the new Recipient
   Context same Sender Sequence
   Number space is initialized as not valid.  Therefore, the endpoint MUST
   take the following actions, before accepting request used for all outgoing messages from
   the client associated to the new Recipient Context.

   If it is not configured as silent server, the endpoint MUST either:

   o  Retrieve new Security Context parameters from the Group Manager
      and derive a new Sender Context, as defined in Section 2.4.1.1; or

   o  When receiving a first request to process protected with the new Recipient
      Context, use the approach specified in Appendix E Group
   OSCORE, thus limiting both storage and based on the
      Echo Option for CoAP [I-D.ietf-core-echo-request-tag], if
      supported.  In particular, complexity.

   On the endpoint MUST use its Partial IV other hand, when generating the AEAD nonce combining group and MUST include pairwise communication
   modes, this may result in the Partial IV values moving forward more
   often.  This can happen when a client engages in frequent or long
   sequences of one-to-one exchanges with servers in the response message conveying the Echo Option. group, by
   sending requests over unicast.

2.4.4.  Security Context for Pairwise Mode

   If the endpoint
      supports the CoAP Echo Option, it is RECOMMENDED to take this
      approach.

   If it pairwise mode is configured exclusively as silent server, the endpoint MUST
   wait for supported, the next group rekeying to occur, in order to derive a new Security Context additionally
   includes Pairwise Key Agreement Algorithm and re-initialize the Replay Window of each
   Recipient Contexts pairwise keys, as valid.

2.4.2.  Exhaustion
   described at the beginning of Sender Sequence Number

   An endpoint can eventually exhaust Section 2.

   The pairwise keys as well as the Sender Sequence Number, which
   is incremented for each new outgoing message including shared secrets used in their
   derivation (see Section 2.4.1) may be stored in memory or recomputed
   every time they are needed.  The shared secret changes only when a Partial IV.
   This is the case
   public/private key pair used for group requests, Observe notifications [RFC7641]
   and, optionally, any other response.

   Implementations MUST be able to detect an exhaustion of Sender
   Sequence Number, after the endpoint has consumed its derivation changes, which
   results in the largest usable
   value.  If an implementation's integers support wrapping addition, pairwise keys also changing.  Additionally, the implementation MUST treat Sender Sequence Number as exhausted
   when a wrap-around is detected.

   Upon exhausting
   pairwise keys change if the Sender Sequence Numbers, the endpoint MUST NOT
   use this Security Context to protect further messages including ID changes or if a
   Partial IV.

   The endpoint SHOULD inform the Group Manager, retrieve new Security
   Context parameters from is established for the Group Manager group (see Section 2.4.3), and
   use them 2.5.3).  In order
   to derive a new optimize protocol performance, an endpoint may store the derived
   pairwise keys for easy retrieval.

   In the pairwise mode, the Sender Context (see Section 2.2).

   From then on, includes the endpoint MUST use its latest installed Pairwise Sender
   Context
   Keys to protect outgoing messages.

2.4.3.  Retrieving New Security Context Parameters

   The Group Manager can assist an endpoint use with an incomplete the other endpoints (see Figure 1).  In order to
   identify the right key to use, the Pairwise Sender
   Context Key for endpoint X
   may be associated to retrieve missing data the Recipient ID of endpoint X, as defined in
   the Security Recipient Context and thereby
   become fully operational in (i.e., the group again.  The two main options Sender ID from the point of view of
   endpoint X).  In this way, the Recipient ID can be used to lookup for
   the Group Manager are described right Pairwise Sender Key. This association may be implemented in this section: i) assignment of
   different ways, e.g., by storing the pair (Recipient ID, Pairwise
   Sender Key) or linking a new Pairwise Sender ID Key to a Recipient Context.

2.5.  Update of Security Context

   It is RECOMMENDED that the endpoint (see Section 2.4.3.1); and ii)
   establishment immutable part of the Security Context is
   stored in non-volatile memory, or that it can otherwise be reliably
   accessed throughout the operation of the group, e.g., after a new device
   reboots.  However, also immutable parts of the Security Context may
   need to be updated, for example due to scheduled key renewal, new or
   re-joining members in the group group, or the fact that the endpoint
   changes Sender ID (see Section 2.4.3.2).  The update 2.5.3).

   On the other hand, the mutable parts of the Replay Window in each Security Context are
   updated by the endpoint when executing the security protocol, but may
   nevertheless become outdated, e.g., due to loss of the
   Recipient Contexts is discussed in mutable
   Security Context (see Section 6.1.

   As group membership changes, 2.5.1) or as group members get new exhaustion of Sender IDs Sequence
   Numbers (see Section 2.4.3.1) so do 2.5.2).

   If it is not feasible or practically possible to store and maintain
   up-to-date the relevant Recipient IDs that mutable part in non-volatile memory (e.g., due to
   limited number of write operations), the other
   endpoints need endpoint MUST be able to keep track of.  As
   detect a consequence, group members may
   end up retaining stale Recipient Contexts, that are no longer useful
   to verify incoming secure messages.

   The Recipient ID ('kid') SHOULD NOT be considered as a persistent loss of the mutable Security Context and
   reliable indicator MUST accordingly
   take the actions defined in Section 2.5.1.

2.5.1.  Loss of Mutable Security Context

   An endpoint may lose its mutable Security Context, e.g., due to a group member.  Such
   reboot (see Section 2.5.1.1) or to an indication can be
   achieved only by using that member's public key, when verifying
   countersignatures overflow of received messages (in group mode), or when
   verifying messages integrity-protected with pairwise keying material
   derived from asymmetric keys (in pairwise mode).

   Furthermore, applications MAY define policies to: i) delete
   (long-)unused Recipient Contexts and reduce
   (see Section 2.5.1.2).

   In such a case, the impact on storage
   space; as well as ii) check with endpoint needs to prevent the Group Manager that re-use of a public key
   is currently nonce
   with the one associated same AEAD key, and to handle incoming replayed messages.

2.5.1.1.  Reboot and Total Loss

   In case a 'kid' value, after a number loss of
   consecutive failed verifications.

2.4.3.1.  New the Sender ID for Context and/or of the Endpoint

   The Group Manager may assign Recipient Contexts
   is detected (e.g., following a new Sender ID reboot), the endpoint MUST NOT protect
   further messages using this Security Context to avoid reusing an endpoint, while
   leaving the Gid, Master Secret and Master Salt unchanged in AEAD
   nonce with the
   group. same AEAD key.

   In this case, the Group Manager MUST assign a Sender ID that
   has never been assigned particular, before resuming its operations in the group under the current Gid
   value.

   Having retrieved group, the
   endpoint MUST retrieve new Sender ID, and potentially other missing
   data of the immutable Security Context, Context parameters from the endpoint can Group
   Manager (see Section 2.5.3) and use them to derive a new Sender
   Context (see Section 2.2).  When doing so, the endpoint resets
   the Sender Sequence Number in its Sender Context to 0, and derives  Since this includes a
   new newly derived
   Sender Key. This is in turn used Key, a server will not reuse the same pair (key, nonce), even
   when using the Partial IV of (old re-injected) requests to possibly derive new Pairwise
   Sender Keys. build the
   AEAD nonce for protecting the corresponding responses.

   From then on, the endpoint MUST use its the latest installed Sender
   Context to protect outgoing messages.

   The assignment of a new Sender ID may be the result of different
   processes.  The endpoint may request  Also, newly created Recipient
   Contexts will have a new Replay Window which is initialized as valid.

   If not able to establish an updated Sender ID, e.g. Context, e.g., because of
   exhaustion
   lack of Sender Sequence Numbers (see Section 2.4.2).  An connectivity with the Group Manager, the endpoint may request to re-join MUST NOT
   protect further messages using the group, e.g. because of losing its
   mutable current Security Context (see Section 2.4.1), and is provided with a
   new Sender ID together with the latest immutable Security Context.

   For the MUST
   NOT accept incoming messages from other group members, as currently
   unable to detect possible replays.

2.5.1.2.  Overflow of Recipient Contexts

   After reaching the maximum amount of Recipient Context corresponding Contexts, an endpoint
   will experience an overflow when installing a new Recipient Context,
   as it requires to
   the old Sender ID becomes stale first delete an existing one (see Section 3.1).

2.4.3.2.  New Security Context for 2.2).

   Every time this happens, the Replay Window of the Group

   The Group Manager may establish a new Security Recipient
   Context for is initialized as not valid.  Therefore, the group
   (see Section 3.1).  The Group Manager does not necessarily establish
   a new Security Context for endpoint MUST
   take the group if one member has an outdated
   Security Context (see Section 2.4.3.1), unless that was already
   planned or required for other reasons.

   All following actions, before accepting request messages from
   the group members need client associated to acquire new Security Context parameters
   from the Group Manager.  Once having acquired new Security Context
   parameters, each group member performs the following actions.

   o  From then on, Recipient Context.

   If it MUST NOT use is not configured as silent server, the current endpoint MUST either:

   *  Retrieve new Security Context to
      start processing new messages for the considered group.

   o  It completes any ongoing message processing for parameters from the considered
      group.

   o  It derives Group Manager
      and install derive a new Security Context.  In particular:

      *  It re-derives the keying material stored in its Sender Context
         and Recipient Contexts (see Context, as defined in Section 2.2).  The Master Salt used
         for the re-derivations is the updated Master Salt parameter if
         provided by the Group Manager, 2.5.1.1; or the empty byte string
         otherwise.

   *  It resets  When receiving a first request to 0 its Sender Sequence Number in its Sender
         Context.

      *  It re-initializes process with the Replay Window of each new Recipient Context.

      *  It resets to 0
      Context, use the sequence number of each ongoing observation
         where it is an observer client approach specified in Appendix E and that it wants to keep
         active.

   From then on, it can resume processing new messages for based on the
   considered group.
      Echo Option for CoAP [I-D.ietf-core-echo-request-tag], if
      supported.  In particular:

   o  It particular, the endpoint MUST use its latest installed Sender Context to protect
      outgoing messages.

   o  It SHOULD use its latest installed Recipient Contexts to process
      incoming messages, unless application policies admit to
      temporarily retain and use Partial IV
      when generating the old, recent, Security Context (see
      Section 10.4.1).

   The distribution of a new Gid and Master Secret may result in
   temporarily misaligned Security Contexts among group members.  In
   particular, this may result in a group member not being able to
   process messages received right after a new Gid and Master Secret
   have been distributed.  A discussion on practical consequences AEAD nonce and
   possible ways to address them, as well as on how to handle MUST include the old
   Security Context, is provided Partial IV in Section 10.4.

3.  The Group Manager

   As with OSCORE, endpoints communicating with Group OSCORE need to
   establish
      the relevant Security Context.  Group OSCORE endpoints need
   to acquire OSCORE input parameters, information about response message conveying the group(s)
   and about other endpoints in Echo Option.  If the group(s).  This specification is
   based on endpoint
      supports the existence of an entity called Group Manager which CoAP Echo Option, it is
   responsible for the group, but does not mandate how RECOMMENDED to take this
      approach.

   If it is configured exclusively as silent server, the Group Manager
   interacts with endpoint MUST
   wait for the next group members.  The responsibilities of the Group
   Manager are compiled rekeying to occur, in Section 3.2.

   It is RECOMMENDED order to use derive a Group Manager new
   Security Context and re-initialize the Replay Window of each
   Recipient Contexts as described in
   [I-D.ietf-ace-key-groupcomm-oscore], where valid.

2.5.2.  Exhaustion of Sender Sequence Number

   An endpoint can eventually exhaust the join process is based
   on Sender Sequence Number, which
   is incremented for each new outgoing message including a Partial IV.
   This is the ACE framework case for authentication and authorization in
   constrained environments [I-D.ietf-ace-oauth-authz].

   The Group Manager assigns unique Group Identifiers (Gids) group requests, Observe notifications [RFC7641]
   and, optionally, any other response.

   Implementations MUST be able to
   different groups under its control, as well as unique detect an exhaustion of Sender IDs (and
   thereby Recipient IDs) to
   Sequence Number, after the members of those groups.  According to
   a hierarchical approach, endpoint has consumed the Gid value assigned to largest usable
   value.  If an implementation's integers support wrapping addition,
   the implementation MUST treat Sender Sequence Number as exhausted
   when a group wrap-around is
   associated to a dedicated space for detected.

   Upon exhausting the values of Sender ID and
   Recipient ID of Sequence Numbers, the members of that group.

   The Group Manager endpoint MUST NOT reassign a Gid value
   use this Security Context to protect further messages including a
   Partial IV.

   The endpoint SHOULD inform the same group, Group Manager, retrieve new Security
   Context parameters from the Group Manager (see Section 2.5.3), and MUST NOT reassign
   use them to derive a new Sender ID within the same group under the
   same Gid value.

   In addition, Context (see Section 2.2).

   From then on, the endpoint MUST use its latest installed Sender
   Context to protect outgoing messages.

2.5.3.  Retrieving New Security Context Parameters

   The Group Manager maintains records can assist an endpoint with an incomplete Sender
   Context to retrieve missing data of the public keys
   of endpoints in a group, Security Context and provides information about thereby
   become fully operational in the group and
   its members to other group members and selected roles.  Upon nodes'
   joining, again.  The two main options
   for the Group Manager collects such public keys and MUST verify
   proof-of-possession are described in this section: i) assignment of the respective private key.

   An endpoint acquires group data such as the Gid and OSCORE input
   parameters including its own
   a new Sender ID from the Group Manager, and
   provides information about its public key to the Group Manager, endpoint (see Section 2.5.3.1); and ii)
   establishment of a new Security Context for
   example upon joining the group.

   A group member can retrieve from the Group Manager the public key and
   other information associated to another member (see
   Section 2.5.3.2).  The update of the group, with
   which it can generate Replay Window in each of the corresponding
   Recipient Context.  In
   particular, the requested public key Contexts is provided together with the discussed in Section 6.2.

   As group membership changes, or as group members get new Sender ID of IDs
   (see Section 2.5.3.1) so do the associated group member.  An application can
   configure relevant Recipient IDs that the other
   endpoints need to keep track of.  As a consequence, group member to asynchronously retrieve information about members may
   end up retaining stale Recipient Contexts, e.g. by Observing [RFC7641] a resource at the
   Group Manager that are no longer useful
   to get updates on the group membership. verify incoming secure messages.

   The Group Manager MAY serve additional entities acting Recipient ID ('kid') SHOULD NOT be considered as signature
   checkers, e.g. intermediary gateways.  These entities do not join a persistent and
   reliable indicator of a group as members, but member.  Such an indication can retrieve be
   achieved only by using that member's public keys key, when verifying
   countersignatures of received messages (in group members from
   the Group Manager, in order to verify counter signatures of group
   messages.  A signature checker MUST be authorized for retrieving
   public keys of members in a specific group mode), or when
   verifying messages integrity-protected with pairwise keying material
   derived from asymmetric keys (in pairwise mode).

   Furthermore, applications MAY define policies to: i) delete
   (long-)unused Recipient Contexts and reduce the Group Manager.
   To this end, the same method mentioned above based impact on storage
   space; as well as ii) check with the ACE
   framework [I-D.ietf-ace-oauth-authz] can be used.

3.1.  Management of Group Keying Material

   In order to establish a new Security Context for a group, a new Group
   Identifier (Gid) for Manager that group and a new value for the Master Secret
   parameter MUST be generated.  When distributing the new Gid and
   Master Secret, public key
   is currently the Group Manager MAY distribute also one associated to a new value for
   the Master Salt parameter, and should preserve the current value 'kid' value, after a number of
   the
   consecutive failed verifications.

2.5.3.1.  New Sender ID of each group member.

   The Group Manager MUST NOT reassign a Gid value to for the same group.
   That is, every group can have a given Gid at most once during its
   lifetime.  An example of Gid format supporting this operation is
   provided in Appendix C. Endpoint

   The Group Manager MUST NOT reassign may assign a previously used new Sender ID
   ('kid') with to an endpoint, while
   leaving the same Gid, Master Secret and Master Salt.  That is, Salt unchanged in the
   group.  In this case, the Group Manager MUST NOT reassign assign a Sender ID value within a same that
   has not been used in the group under since the same latest time when the current
   Gid value (see Section 2.4.3.1).  Within this
   restriction, was assigned to the Group Manager group (see Section 3.2).

   Having retrieved the new Sender ID, and potentially other missing
   data of the immutable Security Context, the endpoint can assign derive a new
   Sender ID used under an
   old Gid value, thus avoiding Context (see Section 2.2).  When doing so, the endpoint resets
   the Sender ID values to irrecoverably grow Sequence Number in size.

   Even when an endpoint joining its Sender Context to 0, and derives a group
   new Sender Key. This is recognized as a current
   member of that group, e.g. through the ongoing secure communication
   association, in turn used to possibly derive new Pairwise
   Sender Keys.

   From then on, the Group Manager endpoint MUST assign use its latest installed Sender
   Context to protect outgoing messages.

   The assignment of a new Sender ID different
   than the one currently used by may be the result of different
   processes.  The endpoint in may request a new Sender ID, e.g., because
   of exhaustion of Sender Sequence Numbers (see Section 2.5.2).  An
   endpoint may request to re-join the group, unless the
   group is rekeyed first e.g., because of losing
   its mutable Security Context (see Section 2.5.1), and is provided
   with a new Gid value is established.

   Figure 2 overviews Sender ID together with the different keying material components,
   considering their relation and possible reuse across latest immutable Security
   Context.

   For the other group rekeying.

 Components changed in lockstep            * Changing members, the Recipient Context corresponding to
   the old Sender ID becomes stale (see Section 3.2).

2.5.3.2.  New Security Context for the Group

   The Group Manager may establish a kid new Security Context for the group
   (see Section 3.2).  The Group Manager does not
     upon necessarily establish
   a new Security Context for the group rekeying                   need changing if one member has an outdated
   Security Context (see Section 2.5.3.1), unless that was already
   planned or required for other reasons.

   All the Group ID
 +----------------------------+
 |                            |            * A kid is not reassigned
 | Master               Group |<--> kid1     under group members need to acquire new Security Context parameters
   from the same Group ID
 | Secret <---> o <--->  ID   |
 |              ^             |<--> kid2 Manager.  Once having acquired new Security Context
   parameters, each group member performs the following actions.

   * Upon changing  From then on, it MUST NOT use the Group ID,
 |              |             |              every current kid should
 |              |             |<--> kid3     be preserved Security Context to
      start processing new messages for efficient
 |              v             |              key rollover
 |         Master Salt        | ... ...
 |         (optional)         | the considered group.

   * After changing Group ID, an
 |                            |              unused kid can be assigned
 +----------------------------+

           Figure 2: Relations among keying material components.

   If required by  It completes any ongoing message processing for the application (see Appendix A.1), it is RECOMMENDED
   to adopt a group key management scheme, considered
      group.

   *  It derives and securely distribute install a new
   value for Security Context.  In particular:

      -  It re-derives the Gid keying material stored in its Sender Context
         and Recipient Contexts (see Section 2.2).  The Master Salt used
         for the re-derivations is the updated Master Secret Salt parameter of the group's
   Security Context, before a new joining endpoint is added to if
         provided by the group Group Manager, or after a currently present endpoint leaves the group.  This is
   necessary empty byte string
         otherwise.

      -  It resets to preserve backward security and forward security 0 its Sender Sequence Number in its Sender
         Context.

      -  It re-initializes the
   group, if the application requires it.

   The specific approach used to distribute new group data is out of the
   scope Replay Window of this document.  However, each Recipient Context.

      -  For each ongoing observation where it is RECOMMENDED an observer client and
         that it wants to keep active, it resets to 0 the Group
   Manager supports Notification
         Number of each associated server (see Section 6.1).

   From then on, it can resume processing new messages for the
   considered group.  In particular:

   *  It MUST use its latest installed Sender Context to protect
      outgoing messages.

   *  It SHOULD use its latest installed Recipient Contexts to process
      incoming messages, unless application policies admit to
      temporarily retain and use the old, recent, Security Context (see
      Section 10.5.1).

   The distribution of the a new Gid and Master Secret
   parameter to the may result in
   temporarily misaligned Security Contexts among group according to the Group Rekeying Process
   described members.  In
   particular, this may result in [I-D.ietf-ace-key-groupcomm-oscore].

3.2.  Responsibilities of the Group Manager

   The Group Manager is responsible for performing the following tasks:

   1.   Creating and managing OSCORE groups.  This includes the
        assignment of a group member not being able to
   process messages received right after a new Gid and Master Secret
   have been distributed.  A discussion on practical consequences and
   possible ways to every newly created group, address them, as well as
        ensuring uniqueness of Gids within the set of its OSCORE groups.

   2.   Defining policies for authorizing the joining of its OSCORE
        groups.

   3.   Handling the join process on how to add new endpoints as group members.

   4.   Establishing the Common Context part of handle the old
   Security Context,
        and providing it to authorized group members during the join
        process, together is provided in Section 10.5.

3.  The Group Manager

   As with the corresponding Sender Context.

   5.   Updating the Gid of its OSCORE, endpoints communicating with Group OSCORE groups, upon renewing need to
   establish the
        respective relevant Security Context.  This includes ensuring that the
        same Gid value is not reassigned  Group OSCORE endpoints need
   to the same group.

   6.   Generating and managing Sender IDs within its acquire OSCORE groups, as
        well as assigning input parameters, information about the group(s)
   and providing them to new about other endpoints during in the
        join process, or to current group members upon request of
        renewal or re-joining. group(s).  This includes ensuring that each Sender ID: document is unique within
        each of based on
   the OSCORE groups; existence of an entity called Group Manager and is responsible for
   the group, but it does not reassigned within mandate how the Group Manager interacts
   with the same group under members.  The responsibilities of the same Gid value, i.e. not even Group Manager
   are compiled together in Section 3.3.

   It is RECOMMENDED to use a current group
        member re-joining Group Manager as described in
   [I-D.ietf-ace-key-groupcomm-oscore], where the same group without a rekeying happening
        first.

   7.   Defining communication policies join process is based
   on the ACE framework for authentication and authorization in
   constrained environments [I-D.ietf-ace-oauth-authz].

   The Group Manager assigns an integer Key Generation Number to each of
   its OSCORE groups,
        and signaling them to new endpoints during the join process.

   8.   Renewing identifying the Security Context current version of an OSCORE group upon membership
        change, by revoking and renewing common security parameters and
        keying material (rekeying).

   9.   Providing the management keying material
   used in that a new endpoint
        requires group.  The first Key Generation Number assigned to participate in the rekeying process, consistently
        with the key management scheme used in the
   every group joined by the
        new endpoint.

   10.  Acting as key repository, in order to handle MUST be 0.  Separately for each group, the public keys value of the members of its OSCORE groups, and providing such public keys
        to other members of
   Key Generation Number increases strictly monotonically, each time the same group upon request.  The actual
        storage of public keys may be entrusted
   Group Manager distributes new keying material to a separate secure
        storage device or service.

   11.  Validating that group (see
   Section 3.2).  That is, if the format and parameters of public keys of current Key Generation Number for a
   group members are consistent with is X, then X+1 will denote the countersignature algorithm keying material distributed and related parameters
   used in that group immediately after the respective OSCORE group. current one.

   The Group Manager described in [I-D.ietf-ace-key-groupcomm-oscore]
   provides these functionalities.

4.  The COSE Object

   Building on Section 5 of [RFC8613], this section defines how to use
   COSE [I-D.ietf-cose-rfc8152bis-struct] assigns unique Group Identifiers (Gids) to wrap and protect data in
   the original message.  OSCORE uses the untagged COSE_Encrypt0
   structure with an Authenticated Encryption with Associated Data
   (AEAD) algorithm.  Unless otherwise specified, the following
   modifications apply
   groups under its control.  Also, for both the group mode and each group, the pairwise mode of Group OSCORE.

4.1.  Counter Signature

   When protecting a message in group mode, Manager
   assigns unique Sender IDs (and thus Recipient IDs) to the 'unprotected' field MUST
   additionally include respective
   group members.  According to a hierarchical approach, the following parameter:

   o  COSE_CounterSignature0: its Gid value
   assigned to a group is set associated to a dedicated space for the counter signature values
   of Sender ID and Recipient ID of the COSE object, computed by the sender as described in
      Sections 3.2 and 3.3 members of [I-D.ietf-cose-countersign], by using its
      private key and according to that group.

   When a node (re-)joins a group, it is provided also with the Counter Signature Algorithm and
      Counter Signature Parameters current
   Gid to use in the Security Context.

      In particular, group, namely the Countersign_structure contains Birth Gid of that node for that
   group.  For each group member, the context text
      string "CounterSignature0", Group Manager MUST store the external_aad as defined
   latest corresponding Birth Gid until that member leaves the group.
   In case the node has in
      Section 4.3 of this specification, and fact re-joined the ciphertext of group, the COSE
      object as payload.

4.2.  The 'kid' and 'kid context' parameters newly
   determined Birth Gid overwrites the one currently stored.

   The value Group Manager maintains records of the 'kid' parameter public keys of endpoints
   in a group, and provides information about the 'unprotected' field of
   response messages MUST be set group and its members
   to other group members and to external principals with selected roles
   (see Section 3.1).  Upon nodes' joining, the Sender ID Group Manager collects
   such public keys and MUST verify proof-of-possession of the
   respective private key.

   An endpoint
   transmitting the message, if the request was protected in group mode.
   That is, unlike in [RFC8613], the 'kid' parameter is always present
   in responses to a request that was protected in acquires group mode.

   The value of data such as the 'kid context' parameter in Gid and OSCORE input
   parameters including its own Sender ID from the 'unprotected' field
   of requests messages MUST be set Group Manager, and
   provides information about its public key to the ID Context, i.e. the Group
   Identifier value (Gid) of Manager, for
   example upon joining the group.  That is, unlike in [RFC8613],

   Furthermore, when joining the 'kid context' parameter is always present in requests.

4.3.  external_aad

   The external_aad group or later on as a group member, an
   endpoint can retrieve from the Group Manager the public key of the Additional Authenticated Data (AAD) is
   different compared
   Group Manager as well as the public key and other information
   associated to OSCORE, other members of the group, with which it can derive
   the corresponding Recipient Context.  Together with the requested
   public keys, the Group Manager MUST provide the Sender ID of the
   associated group members and is defined in this section.

   The same external_aad structure is used the current Key Generation Number in the
   group.  An application can configure a group mode and pairwise
   mode member to asynchronously
   retrieve information about Recipient Contexts, e.g., by Observing
   [RFC7641] a resource at the Group Manager to get updates on the group
   membership.

3.1.  Support for encryption (see Section 5.3 of
   [I-D.ietf-cose-rfc8152bis-struct]), Additional Principals

   The Group Manager MAY serve additional principals acting as well signature
   checkers, e.g., intermediary gateways.  These principals do not join
   a group as members, but can retrieve public keys of group members and
   other selected group data from the Group Manager, in order to solely
   verify countersignatures of messages protected in group mode for
   signing (see
   Section 4.4 of [I-D.ietf-cose-rfc8152bis-struct]). 8.5).

   In particular, the external_aad includes also the counter signature
   algorithm and related order to verify countersignatures of messages in a group, a
   signature parameters, checker needs to retrieve the value of following information about
   that group from the 'kid
   context' Group Manager.

   *  The current ID Context (Gid) used in the COSE object group.

   *  The public keys of the request, group members and the OSCORE option public key of the protected message.

     external_aad = bstr .cbor aad_array

     aad_array = [
        oscore_version : uint,
        algorithms : [alg_aead : int / tstr,
                      alg_countersign : int / tstr,
                      par_countersign : [countersign_alg_capab,
                                         countersign_key_type_capab]],
        request_kid : bstr,
        request_piv : bstr,
        options : bstr,
        request_kid_context : bstr,
        OSCORE_option: bstr
     ]

                          Figure 3: external_aad

   Compared with
      Group Manager.

   *  The current Group Encryption Key (see Section 5.4 2.1.6).

   *  The identifiers of [RFC8613], the aad_array has the
   following differences.

   o  The 'algorithms' array additionally includes:

      *  'alg_countersign', which specifies Counter Signature Algorithm
         from algorithms used in the Common Context group (see
      Section 2.1.2).  This parameter
         MUST encode the value of Counter 2), i.e.: i) Signature Encryption Algorithm as a CBOR
         integer or text string, consistently with and Signature
      Algorithm; and ii) AEAD Algorithm and Pairwise Key Agreement
      Algorithm, if the "Value" field in group uses also the "COSE Algorithms" Registry for this counter pairwise mode.

   A signature
         algorithm.

      *  'par_countersign', which specifies the CBOR array Counter
         Signature Parameters from checker MUST be authorized before it can retrieve such
   information.  To this end, the Common Context (see
         Section 2.1.3).  In particular:

         +  'countersign_alg_capab' is same method mentioned above based on
   the array ACE framework [I-D.ietf-ace-oauth-authz] can be used.

3.2.  Management of COSE capabilities Group Keying Material

   In order to establish a new Security Context for a group, the countersignature algorithm indicated in
            'alg_countersign'.  This is Group
   Manager MUST generate and assign to the first element of group a new Group Identifier
   (Gid) and a new value for the CBOR
            array Counter Signature Parameters from Master Secret parameter.  When doing
   so, a new value for the Common Context.

         +  'countersign_key_type_capab' is Master Salt parameter MAY also be generated
   and assigned to the array of COSE
            capabilities for group.  When establishing the COSE key type used by new Security
   Context, the
            countersignature algorithm indicated in 'alg_countersign'.
            This is Group Manager should preserve the second element current value of the CBOR array Counter
            Signature Parameters from the Common Context.

         This format is consistent with every counter signature
         algorithm currently considered in
         [I-D.ietf-cose-rfc8152bis-algs], i.e. with algorithms that have
         only the COSE key type as their COSE capability.  Appendix H
         describes how 'par_countersign' can be generalized for possible
         future registered algorithms having a different set
   Sender ID of COSE
         capabilities.

   o each group member.

   The specific group key management scheme used to distribute new element 'request_kid_context' contains
   keying material, is out of the value scope of this document.  However, it
   is RECOMMENDED that the
      'kid context' Group Manager supports the Group Rekeying
   Process described in [I-D.ietf-ace-key-groupcomm-oscore].  When
   possible, the COSE object delivery of the request (see Section 4.2).

      In case Observe [RFC7641] is used, this enables endpoints to
      safely keep an observation active beyond rekeying messages should use a possible change of Gid,
      i.e. reliable
   transport, in order to reduce chances of ID Context, following a group members missing a
   rekeying (see Section 3.1).
      In fact, it ensures that every notification cryptographically
      matches with only one observation request, rather than with
      multiple ones that were protected with different keying material
      but share the same 'request_kid' and 'request_piv' values.

   o instance.

   The new element 'OSCORE_option', containing the value set of the
      OSCORE Option present in the protected message, encoded group members should not be assumed as fixed, i.e., the
   group membership is subject to changes, possibly on a
      binary string.  This prevents frequent basis.
   The Group Manager MUST rekey the attack described in Section 10.6 group when using one or more currently
   present endpoints leave the group mode, as further explained group, or in Section 10.6.2.

      Note for implementation: this construction requires the OSCORE
      option of the message order to be generated and finalized before
      computing the ciphertext of the COSE_Encrypt0 object (when using
      the group mode evict them as
   compromised or suspected so.  In either case, this excludes such
   nodes from future communications in the pairwise mode) group, and before calculating thus preserves
   forward security.  If required by the
      counter signature (when using application, the group mode).  Also, Group Manager
   MUST rekey the
      aad_array needs to be large enough group also before one or more new joining endpoints
   are added to contain the largest possible
      OSCORE option.

5.  OSCORE Header Compression group, thus preserving backward security.

   The OSCORE header compression defined in Section 6 establishment of [RFC8613] is
   used, with the following differences.

   o  The payload of new Security Context for the OSCORE message SHALL encode group takes the ciphertext of
   following steps.

   1.  The Group Manager MUST increment by 1 the COSE_Encrypt0 object.  In Key Generation Number
       for the group mode, group.

   2.  The Group Manager MUST check if the ciphertext above
      is concatenated new Gid to be distributed
       coincides with the value of the COSE_CounterSignature0 Birth Gid of
      the COSE object, computed as described in Section 4.1.

   o  This specification defines the usage any of the sixth least
      significant bit, called "Group Flag", in the first byte current group members.
       If any of the
      OSCORE option containing the OSCORE flag bits.  This flag bit such "elder members" is
      specified found in Section 11.1.

   o the group, then:

       *  The Group Flag Manager MUST be set to 1 if evict the OSCORE message is protected
      using elder members from the group.
          That is, the group mode (see Section 8).

   o  The Group Flag Manager MUST be set to 0 if terminate their membership and
          MUST rekey the OSCORE message is protected
      using group in such a way that the pairwise mode (see Section 9).  The Group Flag MUST also
      be set to 0 for ordinary OSCORE messages processed according new keying
          material is not provided to
      [RFC8613].

5.1.  Examples of Compressed COSE Objects those evicted elder members.  This section covers
          ensures that an Observe notification [RFC7641] can never
          successfully match against the Observe requests of two
          different observations.

       *  Until a further following group rekeying, the Group Manager
          MUST store the list of OSCORE Header Compression examples those latest-evicted elder members.  If
          any of
   Group OSCORE used in group mode (see Section 5.1.1) or in pairwise
   mode (see Section 5.1.2).

   The examples assume that those endpoints re-joins the COSE_Encrypt0 object is set (which means group before a further
          following group rekeying occurs, the CoAP message and cryptographic material is known).  Note that Group Manager MUST NOT
          rekey the
   examples do not include group upon their re-joining.  When one of those
          endpoints re-joins the full CoAP unprotected message or group, the full
   Security Context, but only Group Manager can rely,
          e.g., on the input necessary ongoing secure communication association to
          recognize the compression
   mechanism, i.e. the COSE_Encrypt0 object.  The output is the
   compressed COSE object endpoint as defined included in Section 5 and divided into two
   parts, since the object is transported in two CoAP fields: OSCORE
   option and payload. stored list.

   3.  The examples assume that Group Manager MUST build a set of stale Sender IDs including:

       *  The Sender IDs that, during the plaintext current Gid, were both
          assigned to an endpoint and subsequently relinquished (see
          Section 5.3 2.5.3.1).

       *  The current Sender IDs of [RFC8613])
   is 6 bytes long, and that the AEAD tag is 8 bytes long, hence
   resulting in a ciphertext which is 14 bytes long.  When using the group mode, members that the COSE_CounterSignature0 byte string as described in
   Section 4 is assumed upcoming
          group rekeying aims to be 64 bytes long.

5.1.1.  Examples in exclude from future group
          communications, if any.

   4.  The Group Mode

   o  Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid =
      0x25, Partial IV = 5 and kid context = 0x44616c.

      * Before compression (96 bytes):

         [
         h'',
         { 4:h'25', 6:h'05', 10:h'44616c', 11:h'de9e ... f1' },
         h'aea0155667924dff8a24e4cb35b9'
         ] Manager rekeys the group, by distributing:

       * After compression (85 bytes):

         Flag byte: 0b00111001 = 0x39 (1 byte)

         Option Value: 0x39 05 03 44 61 6c 25 (7 bytes)

         Payload: 0xaea0155667924dff8a24e4cb35b9 de9e ... f1
         (14 bytes + size of  The new keying material, i.e., the counter signature)

   o  Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid =
      0x52 new Master Secret, the new
          Gid and no Partial IV. (optionally) the new Master Salt.

       * Before compression (88 bytes):

         [
         h'',
         { 4:h'52', 11:h'ca1e ... b3' },
         h'60b035059d9ef5667c5a0710823b'
         ]  The new Key Generation Number from step 1.

       * After compression (80 bytes):

         Flag byte: 0b00101000 = 0x28 (1 byte)

         Option Value: 0x28 52 (2 bytes)

         Payload: 0x60b035059d9ef5667c5a0710823b ca1e ... b3
         (14 bytes + size  The set of stale Sender IDs from step 3.

       Further information may be distributed, depending on the counter signature)

5.1.2.  Examples specific
       group key management scheme used in Pairwise Mode

   o  Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid =
      0x25, Partial IV = 5 the group.

   When receiving the new group keying materal, a group member considers
   the received stale Sender IDs and kid context = 0x44616c.

      * Before compression (29 bytes):

         [
         h'',
         { 4:h'25', 6:h'05', 10:h'44616c' },
         h'aea0155667924dff8a24e4cb35b9'
         ] performs the following actions.

   * After compression (21 bytes):

         Flag byte: 0b00011001 = 0x19 (1 byte)

         Option Value: 0x19 05 03 44 61 6c 25 (7 bytes)

         Payload: 0xaea0155667924dff8a24e4cb35b9 (14 bytes)

   o  Response with ciphertext = 0x60b035059d9ef5667c5a0710823b and no
      Partial IV.

      * Before compression (18 bytes):

         [
         h'',
         {},
         h'60b035059d9ef5667c5a0710823b'
         ]

      * After compression (14 bytes):

         Flag byte: 0b00000000 = 0x00 (1 byte)

         Option Value: 0x (0 bytes)

         Payload: 0x60b035059d9ef5667c5a0710823b (14 bytes)

6.  Message Binding, Sequence Numbers, Freshness and Replay Protection  The requirements and properties described in Section 7 of [RFC8613]
   also apply to Group OSCORE.  In particular, Group OSCORE provides
   message binding of responses group member MUST remove every public key associated to requests, which enables absolute
   freshness of responses that are not notifications, relative freshness
   of requests and notification responses, and replay protection of
   requests.  In addition, the following holds for Group OSCORE.

6.1.  Update of Replay Window

   Sender Sequence Numbers seen by a server as Partial IV values in
   request messages can spontaneously increase at a fast pace, for
   example when a client exchanges unicast messages with other servers
   using the Group OSCORE Security Context.  As
      stale Sender ID from its list of group members' public keys used
      in OSCORE [RFC8613], a
   server always needs to accept such increases and accordingly updates the Replay Window in group.

   *  The group member MUST delete each of its Recipient Contexts.

   As discussed Contexts used
      in Section 2.4.1, a newly created Recipient Context
   would have an invalid Replay Window, if its installation has required
   to delete another Recipient Context.  Hence, the server group whose corresponding Recipient ID is not able
   to verify if a request from stale Sender
      ID.

   After that, the client associated to group member installs the new
   Recipient Context is a replay.  When this happens, keying material and
   derives the server MUST
   validate corresponding new Security Context.

   A group member might miss one group rekeying or more consecutive
   instances.  As a result, the Replay Window of group member will retain old group
   keying material with Key Generation Number GEN_OLD.  Eventually, the new Recipient Context, before
   accepting messages from
   group member can notice the associated client (see Section 2.4.1).

   Furthermore, when discrepancy, e.g., by repeatedly failing
   to verify incoming messages, or by explicitly querying the Group
   Manager establishes a new Security
   Context for the group (see Section 2.4.3.2), every server re-
   initializes current Key Generation Number.  Once the Replay Window in each group member
   gains knowledge of its Recipient Contexts.

6.2.  Message Freshness

   When receiving having missed a request group rekeying, it MUST delete the
   old keying material it owns.

   Then, the group member proceeds according to the following steps.

   1.  The group member retrieves from a client for the first time, Group Manager the server
   is not synchronized current
       group keying material, together with the client's Sender Sequence Number, i.e. it
   is not able to verify if that request is fresh.  This applies to a
   server that has just joined current Key Generation
       Number GEN_NEW.  The group member MUST NOT install the group, with respect to already
   present clients, and recurs as new clients are added as obtained
       group
   members.

   During its operations in keying material yet.

   2.  The group member asks the group, Group Manager for the server may also lose
   synchronization with a client's set of stale
       Sender Sequence Number.  This IDs.

   3.  If no exact indication can
   happen, for instance, if be obtained from the server has rebooted or has deleted its
   previously synchronized version of Group Manager,
       the Recipient Context for that
   client (see Section 2.4.1).

   If the application requires message freshness, e.g. according to
   time- or event-based policies, group member MUST remove all the server has to (re-)synchronize
   with a client's Sender Sequence Number before delivering request
   messages public keys from that client to the application.  To this end, the
   server can use its list of
       group members' public keys used in the approach group and MUST delete all
       its Recipient Contexts used in Appendix E based on the Echo Option
   for CoAP [I-D.ietf-core-echo-request-tag], as a variant of group.

       Otherwise, the
   approach defined in Appendix B.1.2 of [RFC8613] applicable to Group
   OSCORE.

7.  Message Reception

   Upon receiving a protected message, a recipient endpoint retrieves a
   Security Context as in [RFC8613].  An endpoint group member MUST be able to
   distinguish between a Security Context remove every public key
       associated to process OSCORE messages as
   in [RFC8613] and a Group OSCORE Security Context to process Group
   OSCORE messages as defined in this specification.

   To this end, an endpoint can take into account the different
   structure stale Sender ID from its list of the Security Context defined group members'
       public keys used in Section 2, for example
   based on the presence group, and MUST delete each of Counter Signature Algorithm its
       Recipient Contexts used in the Common group whose corresponding
       Recipient ID is a stale Sender ID.

   4.  The group member installs the current group keying material, and
       derives the corresponding new Security Context.  Alternatively implementations

   Alternatively, the group member can use an additional
   parameter in re-join the Security Context, to explicitly signal that it is
   intended for processing Group OSCORE messages.

   If either group.  In such a
   case, the group member MUST take one of the following two conditions holds, a recipient endpoint
   MUST discard the incoming protected message:

   o actions.

   *  The Group Flag is set to 0, group member performs steps 2 and 3 above.  Then, the recipient endpoint retrieves a
      Security Context which is both valid to process group
      member re-joins the group.

   *  The group member re-joins the group with the same roles it
      currently has in the message and
      also associated to an OSCORE group, but and, during the endpoint does not
      support re-joining process, it
      asks the pairwise mode.

   o  The Group Flag is Manager for the public keys of all the current
      group members.

      Then, given Z the set to 1, and of public keys received from the recipient endpoint can not
      retrieve a Security Context Group
      Manager, the group member removes every public key which is both valid to process not in
      Z from its list of group members' public keys used in the
      message group,
      and also associated to an OSCORE group.

      As per Section 6.1 deletes each of [RFC8613], this holds also when retrieving a
      Security Context which is valid but not associated to an OSCORE
      group.  Future specifications may define how to process incoming
      messages protected with a Security its Recipient Contexts as used in [RFC8613], when the Group Flag bit is set to 1.

   Otherwise, if a Security Context associated to an OSCORE group that
      does not include any of the public keys in Z.

   By removing public keys and
   valid deleting Recipient Contexts associated to process the message
   stale Sender IDs, it is retrieved, the ensured that a recipient endpoint
   processes the message with Group OSCORE, using owning the
   latest group mode (see
   Section 8) if keying material does not store the Group Flag is set to 1, or public keys of sender
   endpoints that are not current group members.  This in turn allows
   group members to rely on owned public keys to confidently assert the pairwise
   group membership of sender endpoints, when receiving incoming
   messages protected in group mode (see Section 9) if 8).

3.2.1.  Recycling of Identifiers

   Although the Group Flag Gid value changes every time a group is set to 0.

   Note that, if rekeyed, the
   Group Flag is set Manager can reassign a Gid to 0, and the recipient endpoint
   retrieves same group over that group's
   lifetime.  This would happen, for instance, once the whole space of
   Gid values has been used for the group in question.

   From the moment when a Security Context which Gid is valid assigned to process a group until the message
   but moment a
   new Gid is not associated assigned to an OSCORE that same group, then the message is
   processed according to [RFC8613].

8.  Message Processing in Group Mode

   When using Manager MUST NOT
   reassign a Sender ID within the group mode, messages are protected and processed as
   specified in [RFC8613], group.  This prevents to reuse a
   Sender ID ('kid') with the modifications described in same Gid, Master Secret and Master Salt.
   Within this
   section.  The security objectives of the group mode are discussed in
   Appendix A.2.  The group mode MUST be supported.

   During all the steps of restriction, the message processing, Group Manager can assign a Sender ID
   used under an endpoint MUST use
   the same Security Context for the considered group.  That is, old Gid value (including under a same, recycled Gid
   value), thus avoiding Sender ID values to irrecoverably grow in size.

   Even when an endpoint MUST NOT install joining a new Security Context for that group (see
   Section 2.4.3.2) until the message processing is completed.

   The group mode MUST be used to protect group requests intended for
   multiple recipients or for the whole group.  This includes both
   requests directly addressed to multiple recipients, e.g. sent by the
   client over multicast, as well recognized as requests sent by the client over
   unicast to a proxy, current
   member of that forwards them to group, e.g., through the intended recipients
   over multicast [I-D.ietf-core-groupcomm-bis].

   As per [RFC7252][I-D.ietf-core-groupcomm-bis], group requests sent
   over multicast ongoing secure communication
   association, the Group Manager MUST be Non-Confirmable, and thus are not
   retransmitted assign a new Sender ID different
   than the one currently used by the CoAP messaging layer.  Instead, applications
   should store such outgoing messages for a predefined, sufficient
   amount of time, endpoint in order to correctly perform possible
   retransmissions at the application layer.  According to Section 5.2.3
   of [RFC7252], responses to Non-Confirmable group requests SHOULD also
   be Non-Confirmable, but endpoints MUST be prepared to receive
   Confirmable responses in reply to a Non-Confirmable group request.
   Confirmable group requests are acknowledged in non-multicast
   environments, as specified in [RFC7252].

   Furthermore, endpoints in group, unless the
   group locally perform error handling is rekeyed first and processing of invalid messages according to the same principles
   adopted in [RFC8613].  However, a recipient MUST stop processing and
   silently reject any message which new Gid value is malformed established.

   Figure 2 overviews the different keying material components,
   considering their relation and possible reuse across group rekeying.

 Components changed in lockstep
     upon a group rekeying
 +----------------------------+            * Changing a kid does not follow
 |                            |              need changing the format specified in Section 4 of this specification, or which is
   not cryptographically validated in a successful way.  In either case,
   it Group ID
 | Master               Group |<--> kid1
 | Secret <---> o <--->  ID   |            * A kid is RECOMMENDED that the recipient does not send back any error
   message.  This prevents servers from replying with multiple error
   messages to a client sending a group request, so avoiding the risk of
   flooding and possibly congesting the network.

8.1.  Protecting reassigned
 |              ^             |<--> kid2     under the Request

   A client transmits a secure group request as described in Section 8.1 ongoing usage of [RFC8613], with
 |              |             |              the following modifications.

   o  In step 2, current Group ID
 |              |             |<--> kid3
 |              v             |            * Upon changing the Additional Authenticated Data Group ID,
 |         Master Salt        | ... ...      every current kid should
 |         (optional)         |              be preserved for efficient
 |                            |              key rollover
 | The Key Generation Number  |
 | is modified as
      described in Section 4 of this document.

   o  In step 4, the encryption incremented by 1        |            * After changing Group ID, an
 |                            |              unused kid can be assigned
 +----------------------------+

         Figure 2: Relations among keying material components.

3.3.  Responsibilities of the COSE object is modified as
      described in Section 4 of this document. Group Manager

   The encoding of the
      compressed COSE object Group Manager is modified as described in Section 5 of
      this document.  In particular, responsible for performing the Group Flag MUST be set to following tasks:

   1.

   o  In step 5, the counter signature is computed   Creating and managing OSCORE groups.  This includes the format
        assignment of a Gid to every newly created group, ensuring
        uniqueness of Gids within the set of its OSCORE message is modified as described in Section 4 groups, and Section 5
      of this document.  In particular,
        tracking the payload Birth Gids of current group members in each group.

   2.   Defining policies for authorizing the joining of its OSCORE
      message includes also the counter signature.

8.1.1.  Supporting Observe

   If Observe [RFC7641] is supported, the following holds for each newly
   started observation.

   o  If
        groups.

   3.   Handling the client intends join process to keep add new endpoints as group members.

   4.   Establishing the observation active beyond a
      possible change Common Context part of Sender ID, the client MUST store Security Context,
        and providing it to authorized group members during the value of join
        process, together with the 'kid' parameter from corresponding Sender Context.

   5.   Updating the original Observe request, Key Generation Number and retain
      it for the whole duration Gid of its OSCORE
        groups, upon renewing the observation.  Even in case the
      client is individually rekeyed respective Security Context.

   6.   Generating and receives a managing Sender IDs within its OSCORE groups, as
        well as assigning and providing them to new endpoints during the
        join process, or to current group members upon request of
        renewal or re-joining.  This includes ensuring that:

        *  Each Sender ID from is unique within each of the Group Manager (see Section 2.4.3.1), OSCORE groups;

        *  Each Sender ID is not reassigned within the client MUST NOT
      update same group since
           the stored latest time when the current Gid value associated was assigned to a particular Observe
      request.

   o  If
           the client intends to keep group.  That is, the observation active beyond a
      possible change of Sender ID Context following is not reassigned even to
           a current group rekeying (see
      Section 3.1), then the following applies.

      *  The client MUST store the value of member re-joining the 'kid context' parameter
         from the original Observe request, and retain it same group, without a
           rekeying happening first.

   7.   Defining communication policies for the whole
         duration each of the observation.  Upon establishing a new Security
         Context with a new Gid as ID Context (see Section 2.4.3.2), the
         client MUST NOT update the stored value associated its OSCORE groups,
        and signaling them to a
         particular Observe request.

      *  The client MUST store an invariant identifier of new endpoints during the group,
         which is immutable even in case join process.

   8.   Renewing the Security Context of the
         group is re-established.  For example, this invariant
         identifier can be the "group name" in
         [I-D.ietf-ace-key-groupcomm-oscore], where it is used for
         joining the an OSCORE group upon membership
        change, by revoking and renewing common security parameters and retrieving the current group
        keying material from the Group Manager.

         After a group rekeying, such an invariant information makes it
         simpler for the observer client to retrieve (rekeying).

   9.   Providing the current group management keying material from the Group Manager, that a new endpoint
        requires to participate in case the client has
         missed both the rekeying messages and the first observe
         notification protected process, consistently
        with the new Security Context (see
         Section 8.3.1).

8.2.  Verifying key management scheme used in the Request

   Upon receiving a secure group request with the Group Flag set to 1,
   following joined by the procedure in Section 7,
        new endpoint.

   10.  Assisting a server proceeds group member that has missed a group rekeying
        instance to understand which public keys and Recipient Contexts
        to delete, as described associated to former group members.

   11.  Acting as key repository, in Section 8.2 order to handle the public keys of [RFC8613], with
        the following modifications.

   o  In step 2, members of its OSCORE groups, and providing such public keys
        to other members of the decoding same group upon request.  The actual
        storage of public keys may be entrusted to a separate secure
        storage device or service.

   12.  Validating that the format and parameters of public keys of
        group members are consistent with the compressed public key algorithm and
        related parameters used in the respective OSCORE group.

   The Group Manager described in [I-D.ietf-ace-key-groupcomm-oscore]
   provides these functionalities.

4.  The COSE object follows Object

   Building on Section 5 of [RFC8613], this document.  In particular:

      *  If the server discards the request due section defines how to not retrieving a
         Security Context associated use
   COSE [I-D.ietf-cose-rfc8152bis-struct] to wrap and protect data in
   the original message.  OSCORE group, uses the server MAY
         respond untagged COSE_Encrypt0
   structure with a 4.01 (Unauthorized) error message.  When doing
         so, the server MAY set an Outer Max-Age option Authenticated Encryption with value zero,
         and MAY include a descriptive string as diagnostic payload.

      *  If the received 'kid context' matches an existing ID Context
         (Gid) but the received 'kid' does not match any Recipient ID in
         this Security Context, then Associated Data
   (AEAD) algorithm.  Unless otherwise specified, the server MAY create a new
         Recipient Context following
   modifications apply for this Recipient ID and initialize it
         according to Section 3 of [RFC8613], both the group mode and also retrieve the
         associated public key.  Such pairwise mode of
   Group OSCORE.

4.1.  Countersignature

   When protecting a configuration message in group mode, the 'unprotected' field MUST
   additionally include the following parameter:

   *  COSE_CounterSignature0: its value is application
         specific.  If set to the application does not specify dynamic
         derivation encrypted
      countersignature of new Recipient Contexts, then the server SHALL
         stop processing the request.

   o  In step 4, COSE object, namely ENC_SIGNATURE.  That
      is:

      -  The countersignature of the Additional Authenticated Data COSE object, namely SIGNATURE, is modified
         computed by the sender as described in Section 4 Sections 3.2 and 3.3 of this document.

   o  In step 6, the server also verifies the counter signature
         [I-D.ietf-cose-countersign], by using
      the public its private key of and
         according to the client from Signature Algorithm in the associated Recipient Security Context.

         In particular:

      *  If particular, the server does not have Countersign_structure contains the public key of context
         text string "CounterSignature0", the client yet, external_aad as defined in
         Section 4.3 of this document, and the server MUST stop processing ciphertext of the request and MAY respond
         with a 5.03 (Service Unavailable) response. COSE
         object as payload.

      -  The response MAY
         include a Max-Age Option, indicating to the client encrypted countersignature, namely ENC_SIGNATURE, is
         computed as

         ENC_SIGNATURE = SIGNATURE XOR KEYSTREAM

         where KEYSTREAM is derived as per Section 4.1.1.

4.1.1.  Keystream Derivation

   The following defines how an endpoint derives the number
         of seconds after which keystream
   KEYSTREAM, used to retry.  If encrypt/decrypt the Max-Age Option is not
         present, a retry time countersignature of 60 seconds will an
   outgoing/incoming message M protected in group mode.

   The keystream SHALL be assumed derived as follows, by using the
         client, as default value defined in HKDF
   Algorithm from the Common Context (see Section 5.10.5 3.2 of
         [RFC7252]. [RFC8613]),
   which consists of composing the HKDF-Extract and HKDF-Expand steps
   [RFC5869].

   KEYSTREAM = HKDF(salt, IKM, info, L)

   The input parameters of HKDF are as follows.

   *  If  salt takes as value the signature verification fails, Partial IV (PIV) used to protect M.  Note
      that, if M is a response, salt takes as value either: i) the server SHALL stop
         processing fresh
      Partial IV generated by the request server and MAY respond with a 4.00 (Bad
         Request) response.  The server MAY set an Outer Max-Age option
         with value zero.  The diagnostic payload MAY contain a string,
         which, if present, MUST be "Decryption failed" as if included in the
         decryption had failed.  Furthermore, response;
      or ii) the Replay Window MUST be
         updated only if both same Partial IV of the signature verification request generated by the client
      and not included in the
         decryption succeed.

   o  Additionally, if response.

   *  IKM is the used Recipient Context was created upon
      receiving this group request and Group Encryption Key from the message Common Context (see
      Section 2.1.6).

   *  info is not verified
      successfully, the server MAY delete that Recipient Context.  Such serialization of a configuration, which CBOR array consisting of (the
      notation follows [RFC8610]):

   info = [
     id : bstr,
     id_context : bstr,
     type : bool,
     L: uint
   ]

   where:

   *  id is specified by the application, mitigates
      attacks Sender ID of the endpoint that aim at overloading generated PIV.

   *  id_context is the server's storage.

   A ID Context (Gid) used when protecting M.

      Note that, in case of group rekeying, a server SHOULD NOT process might use a request if
      different Gid when protecting a response, compared to the received Recipient ID
   ('kid') is equal Gid that
      it used to its own Sender ID in its own Sender Context.  For
   an example where this is not fulfilled, verify (that the client used to protect) the request,
      see Section 7.2.1 in
   [I-D.tiloca-core-observe-multicast-notifications].

8.2.1.  Supporting Observe

   If Observe [RFC7641] 8.3.

   *  type is supported, the following holds for each newly
   started observation.

   o  The server MUST store CBOR simple value True (0xf5) if M is a request, or
      the CBOR simple value False (0xf4) otherwise.

   *  L is the size of the 'kid' parameter countersignature, as per Signature Algorithm
      from the
      original Observe request, and retain it for the whole duration of
      the observation.  The server MUST NOT update the stored value of Common Context (see Section 2.1.5), in bytes.

4.1.2.  Clarifications on Using a
      'kid' parameter associated Countersignature

   Note that the literature commonly refers to a particular Observe request, even
      in case the observer client is individually rekeyed and starts
      using countersignature as a new Sender ID received from
   signature computed by a principal A over a document already protected
   by a different principal B.

   However, the Group Manager (see
      Section 2.4.3.1).

   o  The server MUST store COSE_Countersignature0 structure belongs to the value set of the 'kid context' parameter
      from the original Observe request,
   abbreviated countersignatures defined in Sections 3.2 and retain it for the whole
      duration 3.3 of
   [I-D.ietf-cose-countersign], which were designed primarily to deal
   with the observation, beyond a possible change problem of ID
      Context following a encrypted group rekeying (see Section 3.1).  That is,
      upon establishing a new Security Context with a new Gid as ID
      Context (see Section 2.4.3.2), messaging, but where it is
   required to know who originated the server MUST NOT update message.

   Since the
      stored value associated to parameters for computing or verifying the ongoing observation.

8.3.  Protecting abbreviated
   countersignature generated by A are provided by the Response

   If a server generates a CoAP message in response same context used
   to describe the security processing performed by B and to be
   countersigned, these structures are applicable also when the two
   principals A and B are actually the same one, like the sender of a
   Group OSCORE
   request, then the server SHALL follow the description message protected in Section 8.3 group mode.

4.2.  The 'kid' and 'kid context' parameters

   The value of [RFC8613], with the modifications described 'kid' parameter in this section.

   Note that the server always protects a response with the Sender
   Context from its latest Security Context, and that establishing a new
   Security Context resets the Sender Sequence Number to 0 (see
   Section 3.1).

   o  In step 2, the Additional Authenticated Data is modified as
      described in Section 4 'unprotected' field of this document.

   o  In step 3, if the server is using a different Security Context for
      the
   response compared to what was used to verify the request (see
      Section 3.1), then the server messages MUST include its Sender Sequence
      Number as Partial IV in the response and use it be set to build the AEAD
      nonce to protect Sender ID of the response.  This prevents endpoint
   transmitting the AEAD nonce from message, if the request from being reused.

   o  In step 4, the encryption of was protected in group mode.
   That is, unlike in [RFC8613], the COSE object 'kid' parameter is modified as
      described always present
   in Section 4 of this document. responses to a request that was protected in group mode.

   The encoding value of the
      compressed COSE object is modified as described 'kid context' parameter in Section 5 of
      this document.  In particular, the Group Flag 'unprotected' field
   of requests messages MUST be set to 1.
      If the server is using a different ID Context (Gid) for the
      response compared to what was used to verify Context, i.e., the request (see
      Section 3.1), then Group
   Identifier value (Gid) of the new ID Context MUST be included group.  That is, unlike in [RFC8613],
   the 'kid context' parameter of the response.

   o  In step 5, the counter signature is computed and the format always present in requests.

4.3.  external_aad

   The external_aad of the Additional Authenticated Data (AAD) is
   different compared to OSCORE message [RFC8613], and is modified as described defined in Section 5 of this
      document.  In particular, the payload of the OSCORE message
      includes also the counter signature.

8.3.1.  Supporting Observe

   If Observe [RFC7641] is supported, the following holds when
   protecting notifications for an ongoing observation.

   o
   section.

   The server MUST use the stored value of the 'kid' parameter from
      the original Observe request (see Section 8.2.1), as value for the
      'request_kid' parameter in the same external_aad structure is used in group mode and pairwise
   mode for authenticated encryption/decryption (see Section 4.3).

   o  The server MUST use the stored value 5.3 of the 'kid context'
      parameter from the original Observe request (see Section 8.2.1),
   [I-D.ietf-cose-rfc8152bis-struct]), as well as value for the 'request_kid_context' parameter in group mode for
   computing and verifying the
      external_aad structure countersignature (see Section 4.3).

   Furthermore, the server may have ongoing observations started by
   Observe requests protected with an old Security Context.  After
   completing the establishment 4.4 of a new Security Context, the server
   MUST protect
   [I-D.ietf-cose-rfc8152bis-struct]).

   In particular, the following notifications with external_aad includes also the Sender Context of Signature
   Algorithm, the new Security Context.

   For each ongoing observation, Signature Encryption Algorithm, the server can help Pairwise Key
   Agreement Algorithm, the client to
   synchronize, by including also value of the 'kid context' parameter in
   notifications following a group rekeying, with value set to the ID
   Context (Gid) COSE
   object of the new Security Context.

   If there is a known upper limit to request, the duration OSCORE option of a group rekeying,
   the server SHOULD include the 'kid context' parameter during that
   time.  Otherwise, protected message,
   the server SHOULD include it until sender's public key, and the Max-Age has
   expired for Group Manager's public key.

   The external_aad SHALL be a CBOR array wrapped in a bstr object as
   defined below, following the last notification sent before the installation notation of the
   new Security Context.

8.4.  Verifying the Response

   Upon receiving a secure response message [RFC8610]:

     external_aad = bstr .cbor aad_array

     aad_array = [
        oscore_version : uint,
        algorithms : [alg_aead : int / tstr / null,
                      alg_signature_enc : int / tstr / null,
                      alg_signature : int / tstr / null,
                      alg_pairwise_key_agreement : int / tstr / null],
        request_kid : bstr,
        request_piv : bstr,
        options : bstr,
        request_kid_context : bstr,
        OSCORE_option: bstr,
        sender_public_key: bstr,
        gm_public_key: bstr / null
     ]

                           Figure 3: external_aad

   Compared with the Group Flag set to
   1, following the procedure in Section 7, the client proceeds as
   described in Section 8.4 5.4 of [RFC8613], with the following
   modifications.

   Note that a client may receive a response protected with a Security
   Context different from aad_array has the one used
   following differences.

   *  The 'algorithms' array is extended as follows.

      The parameter 'alg_aead' MUST be set to protect the corresponding CBOR simple value Null
      if the group request, and that, upon does not use the establishment of a new Security
   Context, pairwise mode, regardless whether
      the client re-initializes its Replay Windows in its
   Recipient Contexts (see Section 3.1).

   o  In step 2, endpoint supports the decoding pairwise mode or not.  Otherwise, this
      parameter MUST encode the value of AEAD Algorithm from the compressed COSE object is modified Common
      Context (see Section 2.1.1), as described in per Section 5 5.4 of this document.  In particular, a
      'kid' may not be present, if the response is a reply to a request
      protected in pairwise mode.  In such a case, [RFC8613].

      Furthermore, the client assumes 'algorithms' array additionally includes:

      -  'alg_signature_enc', which specifies Signature Encryption
         Algorithm from the response 'kid' to Common Context (see Section 2.1.5).  This
         parameter MUST be exactly the one of the server set to which
      the request protected in pairwise mode was intended for.

      If the response 'kid context' matches an existing ID Context (Gid)
      but CBOR simple value Null if the received/assumed 'kid'
         group does not match any Recipient ID in use the group mode, regardless whether the
         endpoint supports the group mode or not.  Otherwise, this Security Context, then
         parameter MUST encode the client MAY create value of Signature Encryption
         Algorithm as a new Recipient
      Context CBOR integer or text string, consistently with
         the "Value" field in the "COSE Algorithms" Registry for this Recipient ID and initialize it according to
         AEAD algorithm.

      -  'alg_signature', which specifies Signature Algorithm from the
         Common Context (see Section 3 of [RFC8613], and also retrieve 2.1.5).  This parameter MUST be set
         to the associated public
      key.  If CBOR simple value Null if the application group does not specify dynamic derivation of
      new Recipient Contexts, then use the client SHALL stop processing
         group mode, regardless whether the
      response.

   o  In step 3, endpoint supports the Additional Authenticated Data is modified as
      described in Section 4 of group
         mode or not.  Otherwise, this document.

   o  In step 5, the client also verifies the counter signature using parameter MUST encode the public key value
         of Signature Algorithm as a CBOR integer or text string,
         consistently with the server from the associated Recipient
      Context.  If "Value" field in the verification fails, "COSE Algorithms"
         Registry for this signature algorithm.

      -  'alg_pairwise_key_agreement', which specifies Pairwise Key
         Agreement Algorithm from the same steps are taken as
      if Common Context (see
         Section 2.1.5).  This parameter MUST be set to the decryption had failed.

   o  Additionally, CBOR simple
         value Null if the used Recipient Context was created upon
      receiving this response and the message is group does not verified
      successfully, use the client MAY delete that Recipient Context.  Such
      a configuration, which is specified by the application, mitigates
      attacks that aim at overloading pairwise mode,
         regardless whether the client's storage.

8.4.1.  Supporting Observe

   If Observe [RFC7641] is supported, endpoint supports the following holds when verifying
   notifications for an ongoing observation.

   o  The client pairwise mode or
         not.  Otherwise, this parameter MUST use encode the stored value of the 'kid' parameter from
      the original Observe request (see Section 8.1.1),
         Pairwise Key Agreement Algorithm as value for a CBOR integer or text
         string, consistently with the
      'request_kid' parameter "Value" field in the external_aad structure (see
      Section 4.3).

   o "COSE
         Algorithms" Registry for this HKDF algorithm.

   *  The client MUST use new element 'request_kid_context' contains the stored value of the
      'kid context'
      parameter from the original Observe request (see Section 8.1.1),
      as value for the 'request_kid_context' parameter in the
      external_aad structure COSE object of the request (see Section 4.3).

   This ensures that the client can correctly verify notifications, even
   in 4.2).

      In case it Observe [RFC7641] is individually rekeyed and starts using a new Sender ID
   received from the Group Manager (see Section 2.4.3.1), as well as
   when it installs a new Security Context with used, this enables endpoints to
      safely keep an observation active beyond a new possible change of Gid
      (i.e., of ID Context (Gid) Context), following a group rekeying (see
      Section 3.1).

9.  Message Processing in Pairwise Mode

   When using the pairwise mode of Group OSCORE, messages are 3.2).  In fact, it ensures that every notification
      cryptographically matches with only one observation request,
      rather than with multiple ones that were protected
   and processed as in [RFC8613], with different
      keying material but share the modifications described in
   this section. same 'request_kid' and 'request_piv'
      values.

   *  The security objectives of the pairwise mode are
   discussed in Appendix A.2.

   The pairwise mode takes advantage of an existing Security Context for
   the group mode to establish a Security Context shared exclusively
   with any other member.  In order to use the pairwise mode, new element 'OSCORE_option', containing the
   signature scheme value of the group mode MUST support
      OSCORE Option present in the protected message, encoded as a combined signature
   and encryption scheme.
      binary string.  This can be, for example, signature using
   ECDSA, and encryption prevents the attack described in Section 10.7
      when using AES-CCM with a key derived with ECDH.

   The pairwise mode does not support the use of additional entities
   acting group mode, as verifiers further explained in Section 10.7.2.

      Note for implementation: this construction requires the OSCORE
      option of source authentication the message to be generated and integrity finalized before
      computing the ciphertext of the COSE_Encrypt0 object (when using
      the group
   messages, such as intermediary gateways (see Section 3).

   The pairwise mode MAY be supported.  An endpoint implementing only a
   silent server does not support or the pairwise mode.

   If mode) and before calculating the signature algorithm used in
      countersignature (when using the group supports ECDH (e.g.,
   ECDSA, EdDSA), mode).  Also, the pairwise mode MUST aad_array
      needs to be supported by endpoints that
   use large enough to contain the CoAP Echo Option [I-D.ietf-core-echo-request-tag] and/or
   block-wise transfers [RFC7959], for instance for responses after largest possible OSCORE
      option.

   *  The new element 'sender_public_key', containing the
   first block-wise request, sender's
      public key.  This parameter MUST be set to a CBOR byte string,
      which possibly targets all servers encodes the sender's public key in its original binary
      representation made available to other endpoints in the group and includes the CoAP Block2 option (see
      Section 3.7 of
   [I-D.ietf-core-groupcomm-bis]).  This prevents 2.3).

   *  The new element 'gm_public_key', containing the attack described
   in Section 10.7, which leverages requests sent over unicast to a
   single group member and protected with Group Manager's
      public key.  If no Group Manager maintains the group mode.

   Senders cannot use group, this
      parameter MUST encode the pairwise mode CBOR simple value Null.  Otherwise, this
      parameter MUST be set to protect a message intended
   for multiple recipients.  In fact, the pairwise mode is defined only
   between two endpoints and CBOR byte string, which encodes the keying material is thus only
      Group Manager's public key in its original binary representation
      made available to one recipient.

   However, a sender can use the pairwise mode to protect a message sent
   to (but not intended for) multiple recipients, if interested other endpoints in a
   response from only one of them.  For instance, this is useful to
   support the address discovery service group (see Section 2.3).
      This prevents the attack described in Section 10.8.

5.  OSCORE Header Compression

   The OSCORE header compression defined in Section 9.1, when a
   single 'kid' value 6 of [RFC8613] is indicated in
   used, with the following differences.

   *  The payload of a request sent to
   multiple recipients, e.g. over multicast.

   The Group Manager MAY indicate that the group uses also OSCORE message SHALL encode the pairwise
   mode, as part ciphertext of
      the group data provided to candidate group members
   when joining the group.

9.1.  Pre-Conditions COSE_Encrypt0 object.  In order to protect an outgoing message in pairwise the group mode, the sender
   needs to know ciphertext above
      is concatenated with the public key and value of the Recipient ID for COSE_CounterSignature0 of
      the recipient
   endpoint, COSE object, computed as stored described in the Recipient Context associated to that
   endpoint (see Section 2.3.3).

   Furthermore, the sender needs to know 4.1.

   *  This document defines the individual address usage of the
   recipient endpoint.  This information may not be known at any given
   point sixth least significant
      bit, called "Group Flag", in time.  For instance, right after having joined the group, a
   client may know the public key and Recipient ID for a given server,
   but not the addressing information required to reach it with an
   individual, one-to-one request.

   To make addressing information first byte of individual endpoints available,
   servers in the group MAY expose a resource to which a client can send
   a group request targeting a set of servers, identified by their 'kid'
   values OSCORE option
      containing the OSCORE flag bits.  This flag bit is specified in the request payload.
      Section 11.1.

   *  The specified set may Group Flag MUST be
   empty, hence identifying all the servers in set to 1 if the group.  Further
   details of such an interface are out of scope for this document.

9.2.  Main Differences from OSCORE message is protected
      using the group mode (see Section 8).

   *  The Group Flag MUST be set to 0 if the OSCORE message is protected
      using the pairwise mode protects (see Section 9).  The Group Flag MUST also
      be set to 0 for ordinary OSCORE messages between two members processed according to
      [RFC8613].

5.1.  Examples of Compressed COSE Objects

   This section covers a group,
   essentially following [RFC8613], but with the following notable
   differences.

   o  The 'kid' and 'kid context' parameters list of the COSE object are OSCORE Header Compression examples of
   Group OSCORE used
      as defined in group mode (see Section 4.2 of this document.

   o  The external_aad defined 5.1.1) or in Section 4.3 of this document is used
      for the encryption process.

   o  The Pairwise Sender/Recipient Keys used as Sender/Recipient keys
      are derived as defined in Section 2.3 of this document.

9.3.  Protecting the Request

   When using the pairwise mode,
   mode (see Section 5.1.2).

   The examples assume that the request COSE_Encrypt0 object is protected as defined in
   Section 8.1 of [RFC8613], with set (which means
   the differences summarized in
   Section 9.2 of this document.  The following difference also applies.

   o  If Observe [RFC7641] CoAP message and cryptographic material is supported, what defined in Section 8.1.1
      of this document holds.

9.4.  Verifying known).  Note that the Request

   Upon receiving a request with
   examples do not include the Group Flag set full CoAP unprotected message or the full
   Security Context, but only the input necessary to 0, following the
   procedure in Section 7, compression
   mechanism, i.e., the server MUST process it COSE_Encrypt0 object.  The output is the
   compressed COSE object as defined in Section 8.2 of [RFC8613], with 5 and divided into two
   parts, since the differences summarized object is transported in
   Section 9.2 of this document. two CoAP fields: OSCORE
   option and payload.

   The following differences also apply.

   o  If examples assume that the server discards plaintext (see Section 5.3 of [RFC8613])
   is 6 bytes long, and that the request due to not retrieving AEAD tag is 8 bytes long, hence
   resulting in a
      Security Context associated to ciphertext which is 14 bytes long.  When using the OSCORE
   group or to not
      supporting the pairwise mode, the server MAY respond COSE_CounterSignature0 byte string as described in
   Section 4 is assumed to be 64 bytes long.

5.1.1.  Examples in Group Mode

   *  Request with a 4.01
      (Unauthorized) error message or a 4.02 (Bad Option) error message,
      respectively.  When doing so, the server MAY set an Outer Max-Age
      option with value zero, ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid =
      0x25, Partial IV = 5 and MAY include a descriptive string as
      diagnostic payload.

   o  If a new Recipient Context is created for this Recipient ID, new
      Pairwise Sender/Recipient Keys are also derived (see
      Section 2.3.1).  The new Pairwise Sender/Recipient Keys are
      deleted if the Recipient Context is deleted as a result of the
      message not being successfully verified.

   o  If Observe [RFC7641] is supported, what defined in Section 8.2.1 kid context = 0x44616c.

      * Before compression (96 bytes):

         [
         h'',
         { 4:h'25', 6:h'05', 10:h'44616c', 11:h'de9e ... f1' },
         h'aea0155667924dff8a24e4cb35b9'
         ]

      * After compression (85 bytes):

         Flag byte: 0b00111001 = 0x39 (1 byte)

         Option Value: 0x39 05 03 44 61 6c 25 (7 bytes)

         Payload: 0xaea0155667924dff8a24e4cb35b9 de9e ... f1
         (14 bytes + size of this document holds.

9.5.  Protecting the encrypted countersignature)

   *  Response

   When using the pairwise mode, a response is protected as defined in
   Section 8.3 of [RFC8613], with the differences summarized in
   Section 9.2 ciphertext = 0x60b035059d9ef5667c5a0710823b, kid =
      0x52 and no Partial IV.

      * Before compression (88 bytes):

         [
         h'',
         { 4:h'52', 11:h'ca1e ... b3' },
         h'60b035059d9ef5667c5a0710823b'
         ]

      * After compression (80 bytes):

         Flag byte: 0b00101000 = 0x28 (1 byte)

         Option Value: 0x28 52 (2 bytes)

         Payload: 0x60b035059d9ef5667c5a0710823b ca1e ... b3
         (14 bytes + size of this document.  The following differences also apply.

   o  As discussed in Section 2.4.3.1, the server can obtain a new
      Sender ID from the Group Manager.  In such a case, the server can
      help the client to synchronize, by including the 'kid' parameter encrypted countersignature)

5.1.2.  Examples in a response protected Pairwise Mode

   *  Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid =
      0x25, Partial IV = 5 and kid context = 0x44616c.

      * Before compression (29 bytes):

         [
         h'',
         { 4:h'25', 6:h'05', 10:h'44616c' },
         h'aea0155667924dff8a24e4cb35b9'
         ]

      * After compression (21 bytes):

         Flag byte: 0b00011001 = 0x19 (1 byte)

         Option Value: 0x19 05 03 44 61 6c 25 (7 bytes)

         Payload: 0xaea0155667924dff8a24e4cb35b9 (14 bytes)

   *  Response with ciphertext = 0x60b035059d9ef5667c5a0710823b and no
      Partial IV.

      * Before compression (18 bytes):

         [
         h'',
         {},
         h'60b035059d9ef5667c5a0710823b'
         ]

      * After compression (14 bytes):

         Flag byte: 0b00000000 = 0x00 (1 byte)

         Option Value: 0x (0 bytes)

         Payload: 0x60b035059d9ef5667c5a0710823b (14 bytes)

6.  Message Binding, Sequence Numbers, Freshness and Replay Protection

   The requirements and properties described in pairwise mode, even when the request
      was Section 7 of [RFC8613]
   also protected in pairwise mode.

      That is, when responding apply to a request protected in pairwise mode,
      the server SHOULD include the 'kid' parameter in a response
      protected in pairwise mode, if it is replying Group OSCORE.  In particular, Group OSCORE provides
   message binding of responses to requests, which enables absolute
   freshness of responses that client for
      the first time since the assignment are not notifications, relative freshness
   of its new Sender ID.

   o  If requests and notification responses, and replay protection of
   requests.  In addition, the following holds for Group OSCORE.

6.1.  Supporting Observe

   When Observe [RFC7641] is supported, what defined in Section 8.3.1
      of this document holds.

9.6.  Verifying the Response

   Upon receiving used, a response with client maintains for each ongoing
   observation one Notification Number for each different server.  Then,
   separately for each server, the client uses the associated
   Notification Number to perform ordering and replay protection of
   notifications received from that server (see Section 8.4.1).

   Group Flag set OSCORE allows to 0, following preserve an observation active indefinitely,
   even in case the
   procedure group is rekeyed, with consequent change of ID
   Context, or in Section 7, case the observer client MUST process it as obtains a new Sender ID.

   As defined in Section 8.4 of [RFC8613], with the differences summarized in
   Section 9.2 of this document.  The following differences also apply.

   o  If a new Recipient Context is created 8 when discussing support for Observe, this Recipient ID, new
      Pairwise Sender/Recipient Keys are also derived (see
      Section 2.3.1).  The new Pairwise Sender/Recipient Keys are
      deleted if the Recipient Context is deleted as a result of
   achieved by the
      message not being successfully verified.

   o  If Observe [RFC7641] is supported, what defined client and server(s) storing the 'kid' and 'kid
   context' used in Section 8.4.1 the original Observe request, throughout the whole
   duration of this document holds.

10.  Security Considerations

   The same threat model discussed for OSCORE the observation.

   Upon leaving the group or before re-joining the group, a group member
   MUST terminate all the ongoing observations that it has started in Appendix D.1 of
   [RFC8613] holds for Group OSCORE.  In addition, when using
   the group
   mode, source authentication as observer client.

6.2.  Update of messages is explicitly ensured Replay Window

   Sender Sequence Numbers seen by
   means of counter signatures, a server as discussed in Section 10.1.

   The same considerations on supporting Proxy operations discussed for
   OSCORE Partial IV values in Appendix D.2 of [RFC8613] hold
   request messages can spontaneously increase at a fast pace, for
   example when a client exchanges unicast messages with other servers
   using the Group OSCORE.

   The same considerations on protected message fields for OSCORE
   discussed Security Context.  As in Appendix D.3 of [RFC8613] hold for Group OSCORE.

   The same considerations on uniqueness of (key, nonce) pairs for OSCORE discussed [RFC8613], a
   server always needs to accept such increases and accordingly updates
   the Replay Window in Appendix D.4 each of [RFC8613] hold for Group OSCORE.
   This is further its Recipient Contexts.

   As discussed in Section 10.2 of 2.5.1, a newly created Recipient Context
   would have an invalid Replay Window, if its installation has required
   to delete another Recipient Context.  Hence, the server is not able
   to verify if a request from the client associated to the new
   Recipient Context is a replay.  When this document.

   The same considerations on unprotected message fields for OSCORE
   discussed in Appendix D.5 of [RFC8613] hold for Group OSCORE, with happens, the following differences.  First, server MUST
   validate the 'kid context' Replay Window of request the new Recipient Context, before
   accepting messages is part of from the Additional Authenticated Data, thus safely
   enabling to keep observations active beyond associated client (see Section 2.5.1).

   Furthermore, when the Group Manager establishes a possible change of ID new Security
   Context (Gid), following a for the group rekeying (see Section 4.3).  Second, 2.5.3.2), every server re-
   initializes the counter signature included Replay Window in each of its Recipient Contexts.

6.3.  Message Freshness

   When receiving a Group OSCORE message protected in
   group mode is computed also over request from a client for the value of first time, the OSCORE option,
   which server
   is also part of not synchronized with the Additional Authenticated Data used in the
   signing process.  This client's Sender Sequence Number, i.e.,
   it is further discussed in Section 10.6 of this
   document.

   As discussed in Section 6.2.3 of [I-D.ietf-core-groupcomm-bis], Group
   OSCORE addresses security attacks against CoAP listed in Sections
   11.2-11.6 of [RFC7252], especially when run over IP multicast.

   The rest of this section first discusses security aspects not able to be taken
   into account when using Group OSCORE.  Then it goes through aspects
   covered in the security considerations of OSCORE (see Section 12 of
   [RFC8613]), and discusses how they hold when Group OSCORE verify if that request is used.

10.1.  Group-level Security

   The group mode described in Section 8 relies on commonly shared group
   keying material fresh.  This applies to protect communication within a group.  This
   server that has just joined the following implications.

   o  Messages group, with respect to already
   present clients, and recurs as new clients are encrypted at a added as group level (group-level data
      confidentiality), i.e. they can be decrypted by any member of
   members.

   During its operations in the group, but not by an external adversary the server may also lose
   synchronization with a client's Sender Sequence Number.  This can
   happen, for instance, if the server has rebooted or other external
      entities.

   o  The AEAD algorithm provides only group authentication, i.e. it
      ensures has deleted its
   previously synchronized version of the Recipient Context for that a
   client (see Section 2.5.1).

   If the application requires message sent freshness, e.g., according to a group
   time- or event-based policies, the server has been sent by to (re-)synchronize
   with a member
      of client's Sender Sequence Number before delivering request
   messages from that group, but not necessarily by the alleged sender.  This is
      why source authentication client to the application.  To this end, the
   server can use the approach in Appendix E based on the Echo Option
   for CoAP [I-D.ietf-core-echo-request-tag], as a variant of messages sent the
   approach defined in Appendix B.1.2 of [RFC8613] applicable to Group
   OSCORE.

7.  Message Reception

   Upon receiving a group is ensured
      through protected message, a counter signature, which is computed by the sender using
      its own private key recipient endpoint retrieves a
   Security Context as in [RFC8613].  An endpoint MUST be able to
   distinguish between a Security Context to process OSCORE messages as
   in [RFC8613] and then appended a Group OSCORE Security Context to process Group
   OSCORE messages as defined in this document.

   To this end, an endpoint can take into account the message payload.

   Instead, different
   structure of the pairwise mode described Security Context defined in Section 9 protects messages
   by using pairwise symmetric keys, derived from the static-static
   Diffie-Hellman shared secret computed from 2, for example
   based on the asymmetric keys presence of the
   sender and recipient endpoint (see Section 2.3).  Therefore, Signature Algorithm and/or Pairwise Key
   Agreement Algorithm in the
   pairwise mode, Common Context.  Alternatively
   implementations can use an additional parameter in the AEAD algorithm provides both pairwise data-
   confidentiality and source authentication of messages, without using
   counter signatures.

   The long-term storing Security
   Context, to explicitly signal that it is intended for processing
   Group OSCORE messages.

   If either of the Diffie-Hellman shared secret is following conditions holds, a
   potential security issue.  In fact, if recipient endpoint
   MUST discard the shared secret of two group
   members incoming protected message:

   *  The Group Flag is leaked, a third group member can exploit it set to impersonate
   any of those two group members, by deriving 0, and using their pairwise
   key.  The possibility of such leakage should be contemplated, as more
   likely to happen than the leakage of recipient endpoint retrieves a private key,
      Security Context which could be
   rather protected at a significantly higher level than generic memory,
   e.g. by using a Trusted Platform Module.  Therefore, there is a
   trade-off between both valid to process the maximum amount of time a same shared secret is
   stored message and the frequency of its re-computing.

   Note that, even if
      also associated to an OSCORE group, but the endpoint does not
      support the pairwise mode.

   *  The Group Flag is authorized set to be a group member 1, and
   to take part in group communications, there is a risk that it behaves
   inappropriately.  For instance, it can forward the content of
   messages in recipient endpoint retrieves a
      Security Context which is both valid to process the group message and
      also associated to unauthorized entities.  However, in many use
   cases, an OSCORE group, but the devices in endpoint does not
      support the group belong mode.

   *  The Group Flag is set to a common authority 1, and are
   configured by the recipient endpoint can not
      retrieve a commissioner (see Appendix B), Security Context which results in a
   practically limited risk and enables a prompt detection/reaction in
   case of misbehaving.

10.2.  Uniqueness of (key, nonce)

   The proof for uniqueness of (key, nonce) pairs in Appendix D.4 of
   [RFC8613] is also both valid in group communication scenarios.  That is,
   given to process the
      message and also associated to an OSCORE group:

   o  Uniqueness group.

      As per Section 6.1 of Sender IDs within the group is enforced by the Group
      Manager, [RFC8613], this holds also when retrieving a
      Security Context which never reassigns the same Sender ID within the same
      group under the same Gid value.

   o  The case A in Appendix D.4 of [RFC8613] concerns all group
      requests and responses including is valid but not associated to an OSCORE
      group.  Future specifications may define how to process incoming
      messages protected with a Partial IV (e.g.  Observe
      notifications).  In this case, same considerations from [RFC8613]
      apply here Security Contexts as well.

   o  The case B in Appendix D.4 of [RFC8613] concerns responses not
      including a Partial IV (e.g. single response [RFC8613], when
      the Group Flag bit is set to 1.

   Otherwise, if a Security Context associated to an OSCORE group request).
      In this case, same considerations from [RFC8613] apply here as
      well.

   As a consequence, each message encrypted/decrypted with and
   valid to process the same
   Sender Key message is processed by using a different (ID_PIV, PIV) pair.
   This means that nonces used by any fixed encrypting retrieved, the recipient endpoint are
   unique.  Thus, each
   processes the message is processed with a different (key,
   nonce) pair.

10.3.  Management of Group Keying Material

   The approach described in this specification should take into account OSCORE, using the risk of compromise of group members.  In particular, this
   document specifies that a key management scheme for secure revocation
   and renewal of Security Contexts and group keying material should be
   adopted.

   [I-D.ietf-ace-key-groupcomm-oscore] provides a simple rekeying scheme
   for renewing mode (see
   Section 8) if the Security Context in a group.

   Alternative rekeying schemes which are more scalable with Group Flag is set to 1, or the group
   size may be needed in dynamic, large-scale groups where endpoints can
   join and leave at any time, in order to limit pairwise mode (see
   Section 9) if the impact on
   performance due Group Flag is set to the Security Context and keying material update.

10.4.  Update of Security Context and Key Rotation

   A group member can receive a message shortly after the group has been
   rekeyed, and new security parameters and keying material have been
   distributed by 0.

   Note that, if the Group Manager.

   This may result in a client using an old Security Context Flag is set to protect
   a request, 0, and the recipient endpoint
   retrieves a server using a different new Security Context which is valid to
   protect a corresponding response.  As a consequence, clients may
   receive a response protected with a Security Context different from process the one used message
   but is not associated to protect the corresponding request.

   In particular, a server may first get a request protected with the
   old Security Context, an OSCORE group, then install the new Security Context, and only
   after that produce a response to send back message is
   processed according to [RFC8613].

8.  Message Processing in Group Mode

   When using the client.  In such a
   case, group mode, messages are protected and processed as
   specified in Section 8.3, [RFC8613], with the server MUST protect modifications described in this
   section.  The security objectives of the
   potential response using group mode are discussed in
   Appendix A.2.

   The Group Manager indicates that the new Security Context.  Specifically, group uses (also) the
   server MUST include its Sender Sequence Number group
   mode, as Partial IV in part of the
   response and use it group data provided to build the AEAD nonce to protect candidate group members
   when joining the response.
   This prevents group.

   During all the AEAD nonce from steps of the request from being reused with message processing, an endpoint MUST use
   the new same Security Context.

   The client will process that response using Context for the considered group.  That is, an
   endpoint MUST NOT install a new Security Context,
   provided Context for that it has installed the new security parameters and keying
   material before group (see
   Section 2.5.3.2) until the message processing.

   In case block-wise transfer [RFC7959] processing is used, the same
   considerations from Section 7.2 of [I-D.ietf-ace-key-groupcomm] hold.

   Furthermore, as described below, a completed.

   The group rekeying may temporarily
   result in misaligned Security Contexts between mode MUST be used to protect group requests intended for
   multiple recipients or for the sender and
   recipient of a same message.

10.4.1.  Late Update on whole group.  This includes both
   requests directly addressed to multiple recipients, e.g., sent by the Sender

   In this case,
   client over multicast, as well as requests sent by the sender protects client over
   unicast to a message using the old Security
   Context, i.e. before having installed the new Security Context.
   However, proxy, that forwards them to the recipient receives intended recipients
   over multicast [I-D.ietf-core-groupcomm-bis].  For encryption and
   decryption operations, the message after having installed Signature Encryption Algorithm from the new Security Context, and
   Common Context is used.

   As per [RFC7252][I-D.ietf-core-groupcomm-bis], group requests sent
   over multicast MUST be Non-Confirmable, and thus unable to correctly process it.

   A possible way to ameliorate this issue is to preserve are not
   retransmitted by the old,
   recent, Security Context CoAP messaging layer.  Instead, applications
   should store such outgoing messages for a maximum predefined, sufficient
   amount of time defined by the
   application.  By doing so, the recipient can still try time, in order to process the
   received message using the old retained Security Context as a second
   attempt.  This makes particular sense when correctly perform possible
   retransmissions at the recipient is a client,
   that would hence application layer.  According to Section 5.2.3
   of [RFC7252], responses to Non-Confirmable group requests SHOULD also
   be able Non-Confirmable, but endpoints MUST be prepared to process incoming receive
   Confirmable responses protected with
   the old, recent, Security Context used in reply to protect the associated a Non-Confirmable group request.  Instead, a recipient server would better and more
   simply discard an incoming
   Confirmable group request which is not successfully
   processed with the new Security Context.

   This tolerance preserves the processing of secure messages throughout
   a long-lasting key rotation, requests are acknowledged in non-multicast
   environments, as group rekeying processes may likely
   take a long time to complete, especially specified in [RFC7252].

   Furthermore, endpoints in large scale groups.  On the other hand, a former (compromised) group member can abusively
   take advantage of this, locally perform error handling
   and send processing of invalid messages protected with according to the old
   retained Security Context.  Therefore, same principles
   adopted in [RFC8613].  However, a conservative application
   policy should recipient MUST stop processing and
   silently reject any message which is malformed and does not admit follow
   the retention format specified in Section 4 of old Security Contexts.

10.4.2.  Late Update on the Recipient

   In this case, the sender protects document, or which is not
   cryptographically validated in a message using the new Security
   Context, but the recipient receives successful way.  In either case, it
   is RECOMMENDED that message before having
   installed the new Security Context.  Therefore, the recipient would does not be able send back any error
   message.  This prevents servers from replying with multiple error
   messages to correctly process the message and hence discards it.

   If the recipient installs the new Security Context shortly after that
   and the sender endpoint retransmits the message, a client sending a group request, so avoiding the former will
   still be able to receive risk of
   flooding and correctly process the message.

   In any case, possibly congesting the recipient should actively ask network.

8.1.  Protecting the Group Manager for
   an updated Security Context according to an application-defined
   policy, for instance after Request

   A client transmits a given number of unsuccessfully decrypted
   incoming messages.

10.5.  Collision secure group request as described in Section 8.1
   of Group Identifiers [RFC8613], with the following modifications.

   *  In case endpoints are deployed in multiple groups managed by
   different non-synchronized Group Managers, it step 2, the Additional Authenticated Data is possible for Group
   Identifiers modified as
      described in Section 4 of different groups to coincide.

   This does not impair this document.

   *  In step 4, the security encryption of the AEAD algorithm.  In fact, as
   long as the Master Secret COSE object is different for different groups and modified as
      described in Section 4 of this
   condition holds over time, AEAD keys are different among different
   groups. document.  The entity assigning an IP multicast address may help limiting encoding of the
   chances to experience such collisions
      compressed COSE object is modified as described in Section 5 of Group Identifiers.
      this document.  In particular, it may allow the Group Managers of groups using the same
   IP multicast address Flag MUST be set to share their respective list of assigned Group
   Identifiers currently in use.

10.6.  Cross-group Message Injection

   A same endpoint 1.
      The Signature Encryption Algorithm from the Common Context MUST be
      used.

   *  In step 5, the countersignature is allowed to computed and would likely use the same public/
   private key pair in multiple format of the
      OSCORE groups, possibly administered by
   different Group Managers.

   When a sender endpoint sends a message protected in pairwise mode to
   a recipient endpoint is modified as described in an OSCORE group, a malicious group member may
   attempt to inject Section 4 and Section 5
      of this document.  In particular the payload of the message to a different OSCORE group message
      includes also
   including the same endpoints encrypted countersignature (see Section 10.6.1).

   This practically relies on altering the content of 4.1).

8.1.1.  Supporting Observe

   If Observe [RFC7641] is supported, the OSCORE option,
   and having following holds for each newly
   started observation.

   *  If the same MAC in client intends to keep the ciphertext still correctly validating,
   which has observation active beyond a success probability depending on the size
      possible change of Sender ID, the MAC.

   As discussed in Section 10.6.2, client MUST store the attack is practically infeasible
   if value of
      the message is protected in group mode, thanks to 'kid' parameter from the counter
   signature also bound to original Observe request, and retain
      it for the OSCORE option through whole duration of the Additional
   Authenticated Data used observation.  Even in case the signing process (see Section 4.3).

10.6.1.  Attack Description

   Let us consider:

   o  Two OSCORE groups G1
      client is individually rekeyed and G2, with receives a new Sender ID Context (Group ID) Gid1 and
      Gid2, respectively.  Both G1 and G2 use from
      the AEAD cipher AES-CCM-
      16-64-128, i.e. Group Manager (see Section 2.5.3.1), the MAC of client MUST NOT
      update the ciphertext is 8 bytes in size.

   o  A sender endpoint X which is member of both G1 and G2, and uses stored value associated to a particular Observe
      request.

   *  If the same public/private key pair in both groups.  The endpoint X
      has Sender ID Sid1 in G1 and Sender client intends to keep the observation active beyond a
      possible change of ID Sid2 in G2. Context following a group rekeying (see
      Section 3.2), then the following applies.

      -  The pairs
      (Sid1, Gid1) and (Sid2, Gid2) identify client MUST store the same public key value of X in
      G1 the 'kid context' parameter
         from the original Observe request, and G2, respectively.

   o  A recipient endpoint Y which is member retain it for the whole
         duration of both G1 and G2, and uses the same public/private key pair in both groups.  The endpoint Y
      has Sender ID Sid3 in G1 and Sender observation.  Upon establishing a new Security
         Context with a new Gid as ID Sid4 in G2.  The pairs
      (Sid3, Gid1) and (Sid4, Gid2) identify Context (see Section 2.5.3.2), the same public key
         client MUST NOT update the stored value associated to a
         particular Observe request.

      -  The client MUST store an invariant identifier of Y in
      G1 and G2, respectively.

   o  A malicious endpoint Z the group,
         which is also member immutable even in case the Security Context of both G1 and G2.  Hence, Z the
         group is able to derive re-established.  For example, this invariant
         identifier can be the Sender Keys used by X "group name" in G1 and G2.

   When X sends
         [I-D.ietf-ace-key-groupcomm-oscore], where it is used for
         joining the group and retrieving the current group keying
         material from the Group Manager.

         After a message M1 addressed group rekeying, such an invariant information makes it
         simpler for the observer client to Y retrieve the current group
         keying material from the Group Manager, in G1 case the client has
         missed both the rekeying messages and the first observe
         notification protected in
   pairwise mode, Z can intercept M1, and attempt to forge with the new Security Context (see
         Section 8.3.1).

8.2.  Verifying the Request

   Upon receiving a valid
   message M2 secure group request with the Group Flag set to be injected 1,
   following the procedure in G2, making it appear Section 7, a server proceeds as still sent by X
   to Y and valid to be accepted.

   More described
   in detail, Z intercepts and stops message M1, and forges a
   message M2 by changing Section 8.2 of [RFC8613], with the value following modifications.

   *  In step 2, the decoding of the compressed COSE object follows
      Section 5 of this document.  In particular:

      -  If the server discards the request due to not retrieving a
         Security Context associated to the OSCORE group, the server MAY
         respond with a 4.01 (Unauthorized) error message.  When doing
         so, the server MAY set an Outer Max-Age option from M1 with value zero,
         and MAY include a descriptive string as
   follows: diagnostic payload.

      -  If the received 'kid context' is set to G2 (rather than G1); and matches an existing ID Context
         (Gid) but the received 'kid' is set to Sid2 (rather than Sid1).  Then, Z injects message M2
   as addressed to Y in G2.

   Upon receiving M2, there is a probability equal to 2^-64 that Y
   successfully verifies the same unchanged MAC by using the Pairwise
   Recipient Key associated to X in G2.

   Note that Z does not know match any Recipient ID in
         this Security Context, then the pairwise keys of X server MAY create a new
         Recipient Context for this Recipient ID and Y, since initialize it does
   not know and is not able to compute their shared Diffie-Hellman
   secret.  Therefore, Z is not able
         according to check offline if a performed
   forgery is actually valid, before sending Section 3 of [RFC8613], and also retrieve the forged message to G2.

10.6.2.  Attack Prevention in Group Mode

   When
         associated public key.  Such a Group OSCORE message is protected with the group mode, the
   counter signature configuration is computed also over application
         specific.  If the value application does not specify dynamic
         derivation of new Recipient Contexts, then the OSCORE
   option, which is part of server SHALL
         stop processing the request.

   *  In step 4, the Additional Authenticated Data used is modified as
      described in
   the signing process (see Section 4.3).

   That is, other than over 4 of this document.

   *  In step 6, the ciphertext, server also verifies the countersignature is
   computed over: the ID Context (Gid) and the Partial IV, which are
   always present in group requests; as well as using the Sender ID
      public key of the
   message originator, which is always present in group requests as well
   as in responses to requests protected in group mode.

   Since client from the signing process takes as input also associated Recipient Context.
      In particular:

      -  If the ciphertext server does not have the public key of the
   COSE_Encrypt0 object, the countersignature is bound not only to client yet,
         the
   intended OSCORE group, hence to server MUST stop processing the triplet (Master Secret, Master
   Salt, ID Context), but also to a specific Sender ID in that group request and MAY respond
         with a 5.03 (Service Unavailable) response.  The response MAY
         include a Max-Age Option, indicating to its specific symmetric key used for AEAD encryption, hence to the
   quartet (Master Secret, Master Salt, ID Context, Sender ID).

   This makes it practically infeasible to perform the attack described
   in Section 10.6.1, since it would require client the adversary number
         of seconds after which to
   additionally forge a valid countersignature that replaces the
   original one in the forged message M2. retry.  If the countersignature did Max-Age Option is not cover the OSCORE option, the attack
   would still
         present, a retry time of 60 seconds will be possible against response messages protected assumed by the
         client, as default value defined in group
   mode, since Section 5.10.5 of
         [RFC7252].

      -  The server retrieves the same unchanged encrypted countersignature
         ENC_SIGNATURE from the message M1 would
   be also valid in message M2.

   Also, payload, and computes the following attack simplifications would hold, since Z
         original countersignature SIGNATURE as

         SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM

         where KEYSTREAM is
   able derived as per Section 4.1.1.

         The following verification applies to derive the Sender/Recipient Keys of X and Y original
         countersignature SIGNATURE.

      -  The server MUST perform signature verification before
         decrypting the COSE object.  Implementations that cannot
         perform the two steps in G1 this order MUST ensure that no access
         to the plaintext is possible before a successful signature
         verification and G2.
   That is, Z MUST prevent any possible leak of time-related
         information that can also set a convenient Partial IV in yield side-channel attacks.

      -  If the response,
   until the same unchanged MAC is successfully verified by using G2 as
   'request_kid_context', Sid2 as 'request_kid', and signature verification fails, the symmetric key
   associated to X in G2.

   Since server SHALL stop
         processing the Partial IV is 5 bytes in size, this requires 2^40
   operations to test all request, SHALL NOT update the Partial IVs, which can be done in real-
   time.  The probability that a single given message M1 can be used to
   forge Replay Window, and
         MAY respond with a response M2 for 4.00 (Bad Request) response.  The server MAY
         set an Outer Max-Age option with value zero.  The diagnostic
         payload MAY contain a given request would string, which, if present, MUST be equal to 2^-24,
   since there are more MAC values (8 bytes in size) than Partial IV
   values (5 bytes in size).

   Note that, by changing the Partial IV
         "Decryption failed" as discussed above, any member
   of G1 would also be able to forge a valid signed response message M2
   to if the decryption had failed.

      -  When decrypting the COSE object using the Recipient Key, the
         Signature Encryption Algorithm from the Common Context MUST be injected in
         used.

   *  Additionally, if the same used Recipient Context was created upon
      receiving this group G1.

10.7.  Group OSCORE for Unicast Requests

   If a request and the message is intended to be sent over unicast as addressed to not verified
      successfully, the server MAY delete that Recipient Context.  Such
      a
   single group member, it configuration, which is NOT RECOMMENDED for the client to protect
   the request specified by using the group mode as defined in Section 8.1.

   This does not include the case where application, mitigates
      attacks that aim at overloading the client sends a request over
   unicast to server's storage.

   A server SHOULD NOT process a proxy, to be forwarded to multiple intended recipients
   over multicast [I-D.ietf-core-groupcomm-bis].  In this case, the
   client MUST protect the request with if the group mode, even though it received Recipient ID
   ('kid') is sent equal to the proxy over unicast (see Section 8).

   If the client uses the group mode with its own Sender Key to protect
   a unicast request to a group member, ID in its own Sender Context.  For
   an on-path adversary can, right
   then or later on, redirect that request to one/many different group
   member(s) over unicast, or to the whole OSCORE group over multicast.
   By doing so, the adversary can induce the target group member(s) to
   perform actions intended for one group member only.  Note that the
   adversary can be external, i.e. (s)he does example where this is not need to also be a
   member fulfilled, see Sections 7.2.1 and 7.2.4
   of the OSCORE group.

   This is due to the fact that the client [I-D.ietf-core-observe-multicast-notifications].

8.2.1.  Supporting Observe

   If Observe [RFC7641] is not able to indicate supported, the
   single intended recipient in a way which is secure and possible to
   process following holds for Group OSCORE on the each newly
   started observation.

   *  The server side.  In particular, Group
   OSCORE does not protect network addressing information such as MUST store the IP
   address value of the intended recipient server.  It follows that the
   server(s) receiving the redirected request cannot assert whether that
   was 'kid' parameter from the
      original intention Observe request, and retain it for the whole duration of
      the client, and would thus simply
   assume so. observation.  The impact of such an attack depends especially on server MUST NOT update the REST method stored value of
   the a
      'kid' parameter associated to a particular Observe request, i.e. the Inner CoAP Code of even
      in case the OSCORE request message.
   In particular, safe methods such as GET observer client is individually rekeyed and FETCH would trigger
   (several) unintended responses starts
      using a new Sender ID received from the targeted server(s), while not
   resulting in destructive behavior.  On Group Manager (see
      Section 2.5.3.1).

   *  The server MUST store the other hand, non safe
   methods such as PUT, POST and PATCH/iPATCH would result in value of the target
   server(s) taking active actions on their resources and possible
   cyber-physical environment, with 'kid context' parameter
      from the risk of destructive consequences original Observe request, and possible implications retain it for safety.

   A client can instead use the pairwise mode as defined in Section 9.3,
   in order to protect whole
      duration of the observation, beyond a request sent to possible change of ID
      Context following a single group member by using
   pairwise keying material rekeying (see Section 2.3).  This prevents the attack
   discussed above by construction, 3.2).  That is,
      upon establishing a new Security Context with a new Gid as only ID
      Context (see Section 2.5.3.2), the intended server is able
   to derive the pairwise keying material used by MUST NOT update the client
      stored value associated to protect the request.  A client supporting ongoing observation.

8.3.  Protecting the pairwise mode SHOULD use it to
   protect requests sent Response

   If a server generates a CoAP message in response to a single group member over unicast, instead
   of using Group OSCORE
   request, then the group mode.  For an example where this is not fulfilled,
   see Section 7.2.1 server SHALL follow the description in
   [I-D.tiloca-core-observe-multicast-notifications].

   With particular reference to block-wise transfers [RFC7959], Section 3.7 8.3
   of [I-D.ietf-core-groupcomm-bis] points out that, while
   an initial request including the CoAP Block2 option can be sent over
   multicast, any other request in a transfer has to occur over unicast,
   individually addressing the servers in [RFC8613], with the group.

   Additional considerations are discussed modifications described in Appendix E, with respect
   to requests including a CoAP Echo Option
   [I-D.ietf-core-echo-request-tag] this section.

   Note that has to be sent over unicast, as the server always protects a challenge-response method for servers to achieve synchronization of
   clients' response with the Sender Sequence Number.

10.8.  End-to-end Protection

   The same considerations
   Context from Section 12.1 of [RFC8613] hold for Group
   OSCORE.

   Additionally, (D)TLS and Group OSCORE can be combined for protecting
   message exchanges occurring over unicast.  However, it is not
   possible to combine (D)TLS its latest Security Context, and Group OSCORE for protecting message
   exchanges where messages are (also) sent over multicast.

10.9.  Master Secret

   Group OSCORE derives the that establishing a new
   Security Context using resets the same construction
   as OSCORE, and by using Sender Sequence Number to 0 (see
   Section 3.2).

   *  In step 2, the Group Identifier of a group Additional Authenticated Data is modified as the
   related ID Context.  Hence, the same required properties of the
   Security Context parameters discussed
      described in Section 3.3 4 of [RFC8613]
   hold for this document.

   With particular reference to the OSCORE Master Secret, it has to be
   kept secret among

   *  In step 3, if the members of server is using a different Security Context for
      the respective OSCORE group and the
   Group Manager responsible for that group.  Also, the Master Secret
   must have a good amount of randomness, and the Group Manager can
   generate it offline using a good random number generator.  This
   includes the case where response compared to what was used to verify the Group Manager rekeys request (see
      Section 3.2), then the group by
   generating and distributing a new Master Secret.  Randomness
   requirements for security are described in [RFC4086].

10.10.  Replay Protection

   As in OSCORE [RFC8613], also Group OSCORE relies on server MUST include its Sender Sequence
   Numbers included
      Number as Partial IV in the COSE message field 'Partial IV' response and used use it to build the AEAD nonces.

   Note that
      nonce to protect the Partial IV of an endpoint does not necessarily grow
   monotonically.  For instance, upon exhaustion of response.  This prevents the endpoint Sender
   Sequence Number, AEAD nonce from
      the Partial IV also gets exhausted.  As discussed request from being reused.

   *  In step 4, the encryption of the COSE object is modified as
      described in Section 2.4.3, 4 of this results either in document.  The encoding of the endpoint being individually
   rekeyed and getting a new Sender ID, or
      compressed COSE object is modified as described in the establishment Section 5 of
      this document.  In particular, the Group Flag MUST be set to 1.
      The Signature Encryption Algorithm from the Common Context MUST be
      used.

      If the server is using a new
   Security different ID Context in (Gid) for the group.  Therefore, uniqueness of (key, nonce)
   pairs
      response compared to what was used to verify the request (see
      Section 10.2) is preserved also when a 3.2), then the new Security ID Context is established.

   Since one-to-many communication such as multicast usually involves
   unreliable transports, MUST be included in the simplification 'kid
      context' parameter of the Replay Window to response.

      The server can obtain a
   size of 1 suggested in Section 7.4 of [RFC8613] is not viable with
   Group OSCORE, unless exchanges in new Sender ID from the group rely only on unicast
   messages.

   As discussed in Group Manager, when
      individually rekeyed (see Section 6.1, a Replay Window may be initialized as
   not valid, following 2.5.3.1) or when re-joining the loss of mutable Security Context
   Section 2.4.1.
      group.  In particular, Section 2.4.1.1 and Section 2.4.1.2
   define measures that endpoints need to take in such a situation,
   before resuming case, the server can help the client to accept incoming messages from other
      synchronize, by including the 'kid' parameter in a response
      protected in group members.

10.11.  Message Freshness

   As discussed mode, even when the request was protected in
      pairwise mode (see Section 6.2, a server may not be able 9.3).

      That is, when responding to assert
   whether an incoming a request is fresh, protected in case it does not have or has
   lost synchronization with pairwise mode,
      the client's Sender Sequence Number.

   If freshness server SHOULD include the 'kid' parameter in a response
      protected in group mode, if it is relevant replying to that client for the application, the server may
   (re-)synchronize with
      first time since the client's assignment of its new Sender Sequence Number at any
   time, by using ID.

   *  In step 5, the approach described in Appendix E countersignature is computed and based on the
   CoAP Echo Option [I-D.ietf-core-echo-request-tag], as a variant format of the approach defined
      OSCORE message is modified as described in Appendix B.1.2 Section 4 and Section 5
      of [RFC8613] applicable to
   Group OSCORE.

10.12.  Client Aliveness

   Building on Section 12.5 this document.  In particular the payload of [RFC8613], a the OSCORE message
      includes also the encrypted countersignature (see Section 4.1).

8.3.1.  Supporting Observe

   If Observe [RFC7641] is supported, the following holds when
   protecting notifications for an ongoing observation.

   *  The server may MUST use the CoAP Echo
   Option [I-D.ietf-core-echo-request-tag] to verify the aliveness stored value of the client that originated a received request, by using 'kid' parameter from
      the approach
   described original Observe request (see Section 8.2.1), as value for the
      'request_kid' parameter in Appendix E of this specification.

10.13.  Cryptographic Considerations

   The same considerations from the external_aad structure (see
      Section 12.6 4.3).

   *  The server MUST use the stored value of [RFC8613] about the
   maximum Sender Sequence Number hold 'kid context'
      parameter from the original Observe request (see Section 8.2.1),
      as value for Group OSCORE.

   As discussed the 'request_kid_context' parameter in the
      external_aad structure (see Section 2.4.2, an endpoint that experiences 4.3).

   Furthermore, the server may have ongoing observations started by
   Observe requests protected with an
   exhaustion old Security Context.  After
   completing the establishment of its own Sender Sequence Numbers MUST NOT protect
   further messages including a Partial IV, until it has derived a new
   Sender Context.  This prevents Security Context, the endpoint to reuse server
   MUST protect the same AEAD
   nonces following notifications with the same Sender Key.

   In order to renew its own Sender Context, Context of
   the endpoint SHOULD inform new Security Context.

   For each ongoing observation, the Group Manager, which server can either renew help the whole Security Context client to
   synchronize, by means of including also the 'kid context' parameter in
   notifications following a group rekeying, or provide only that endpoint with a new
   Sender value set to the ID value.  In either case,
   Context (Gid) of the endpoint derives a new Sender
   Context, and in particular Security Context.

   If there is a new Sender Key.

   Additionally, known upper limit to the same considerations from Section 12.6 duration of [RFC8613]
   hold a group rekeying,
   the server SHOULD include the 'kid context' parameter during that
   time.  Otherwise, the server SHOULD include it until the Max-Age has
   expired for Group OSCORE, about building the AEAD nonce and last notification sent before the secrecy installation of the
   new Security Context parameters.

   The EdDSA signature algorithm and Context.

8.4.  Verifying the elliptic curve Ed25519
   [RFC8032] are mandatory Response

   Upon receiving a secure response message with the Group Flag set to implement.  For endpoints that support
   1, following the
   pairwise mode, procedure in Section 7, the ECDH-SS + HKDF-256 algorithm specified client proceeds as
   described in Section 6.3.1 8.4 of [I-D.ietf-cose-rfc8152bis-algs] and [RFC8613], with the X25519 curve
   [RFC7748] are also mandatory to implement.

   Constrained IoT devices following
   modifications.

   Note that a client may alternatively represent Montgomery curves receive a response protected with a Security
   Context different from the one used to protect the corresponding
   request, and (twisted) Edwards curves [RFC7748] that, upon the establishment of a new Security Context,
   the client re-initializes its Replay Windows in its Recipient
   Contexts (see Section 3.2).

   *  In step 2, the short-Weierstrass form
   Wei25519, with which decoding of the algorithms ECDSA25519 and ECDH25519 can compressed COSE object is modified
      as described in Section 5 of this document.  In particular, a
      'kid' may not be
   used for signature operations and Diffie-Hellman secret calculation,
   respectively [I-D.ietf-lwig-curve-representations].

   For many constrained IoT devices, it present, if the response is problematic a reply to support more
   than one signature algorithm or multiple whole cipher suites.  As a
   consequence, some deployments using, for instance, ECDSA with NIST
   P-256 may not support request
      protected in pairwise mode.  In such a case, the mandatory signature algorithm but that
   should not client assumes
      the response 'kid' to be an issue the Recipient ID for local deployments.

   The derivation of pairwise keys defined the server to which
      the request protected in Section 2.3.1 is
   compatible with ECDSA and EdDSA asymmetric keys, pairwise mode was intended for.

      If the response 'kid context' matches an existing ID Context (Gid)
      but is the received/assumed 'kid' does not
   compatible with RSA asymmetric keys.  The security of using match any Recipient ID in
      this Security Context, then the same
   key pair client MAY create a new Recipient
      Context for Diffie-Hellman this Recipient ID and for signing is demonstrated in
   [Degabriele].

10.14.  Message Segmentation

   The same considerations from initialize it according to
      Section 12.7 3 of [RFC8613] hold for Group
   OSCORE.

10.15.  Privacy Considerations

   Group OSCORE ensures end-to-end integrity protection [RFC8613], and encryption
   of also retrieve the message payload and all options that are associated public
      key.  If the application does not used for proxy
   operations.  In particular, options are processed according to specify dynamic derivation of
      new Recipient Contexts, then the
   same class U/I/E that they have for OSCORE.  Therefore, client SHALL stop processing the same
   privacy considerations from
      response.

   *  In step 3, the Additional Authenticated Data is modified as
      described in Section 12.8 4 of [RFC8613] hold for Group
   OSCORE.

   Furthermore, this document.

   *  In step 5, the following privacy considerations hold about client also verifies the
   OSCORE option, which may reveal information on countersignature using the communicating
   endpoints.

   o  The 'kid' parameter, which is intended to help a recipient
      endpoint to find
      public key of the right Recipient Context, may reveal
      information about server from the Sender Endpoint.  When both a request and associated Recipient Context.
      In particular:

      -  The client MUST perform signature verification before
         decrypting the corresponding responses include COSE object.  Implementations that cannot
         perform the 'kid' parameter, two steps in this may
      reveal information about both order MUST ensure that no access
         to the plaintext is possible before a successful signature
         verification and MUST prevent any possible leak of time-related
         information that can yield side-channel attacks.

      -  The client sending a request retrieves the encrypted countersignature
         ENC_SIGNATURE from the message payload, and all computes the possibly replying servers sending their own individual
      response.

   o  The 'kid context' parameter, which
         original countersignature SIGNATURE as

         SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM

         where KEYSTREAM is intended to help a recipient
      endpoint derived as per Section 4.1.1.

         The following verification applies to find the right Security Context, reveals information
      about the sender endpoint.  In particular, it reveals that original
         countersignature SIGNATURE.

      -  If the
      sender endpoint is a member verification of a particular OSCORE group, whose
      current Group ID is indicated in the 'kid context' parameter.

   When receiving countersignature fails, the server
         SHALL stop processing the response, and SHALL NOT update the
         Notification Number associated to the server if the response is
         an Observe notification [RFC7641].

      -  After a group request, each successful verification of the recipient endpoints can
   reply with a response that includes its Sender ID as 'kid' parameter.
   All these responses will be matchable with countersignature, the request through
         client performs also the
   Token.  Thus, even following actions if these responses do the response is
         not include a 'kid context'
   parameter, it becomes possible to understand that an Observe notification.

         o  In case the responder
   endpoints are request was protected in pairwise mode and the same group of
            'kid' parameter is present in the requester endpoint.

   Furthermore, using response, the mechanisms described in Appendix E client
            checks whether this received 'kid' is equal to achieve
   Sender Sequence Number synchronization with a the expected
            'kid', i.e., the known Recipient ID for the server to which
            the request was intended for.

         o  If this is not the case, the client may reveal when
   a checks whether the
            server device goes through a reboot. that has sent the response is the same one to which
            the request was intended for.  This can be mitigated done by checking
            that the
   server device storing public key used to verify the precise state countersignature of
            the Replay Window of each
   known client on a clean shutdown.

   Finally, response is equal to the mechanism described in Section 10.5 Recipient Public Key taken as
            input to prevent
   collisions of Group Identifiers from different Group Managers may
   reveal information about events in derive the respective OSCORE groups.  In
   particular, Pairwise Sender Key used for protecting
            the request (see Section 2.4.1).

         o  If the client determines that the response has come from a Group Identifier changes when
            different server than the corresponding group
   is rekeyed.  Thus, Group Managers might use expected one, then the shared list of Group
   Identifiers to infer client
            SHALL discard the rate response and patterns of group membership
   changes triggering a group rekeying, e.g. due to newly joined members
   or evicted (compromised) members.  In order to alleviate this privacy
   concern, SHALL NOT deliver it should be hidden from to the Group Managers which exact
   Group Manager has currently assigned which Group Identifiers in its
   OSCORE groups.

11.  IANA Considerations

   Note to RFC Editor: Please replace "[This Document]" with
            application.  Otherwise, the RFC
   number of client hereafter considers the
            received 'kid' as the current Recipient ID for the server.

      -  When decrypting the COSE object using the Recipient Key, the
         Signature Encryption Algorithm from the Common Context MUST be
         used.

   *  Additionally, if the used Recipient Context was created upon
      receiving this specification response and the message is not verified
      successfully, the client MAY delete this paragraph.

   This document has that Recipient Context.  Such
      a configuration, which is specified by the following actions for IANA.

11.1.  OSCORE Flag Bits Registry

   IANA application, mitigates
      attacks that aim at overloading the client's storage.

8.4.1.  Supporting Observe

   If Observe [RFC7641] is asked to add supported, the following holds when verifying
   notifications for an ongoing observation.

   *  The client MUST use the stored value entry to of the "OSCORE Flag
   Bits" subregistry defined 'kid' parameter from
      the original Observe request (see Section 8.1.1), as value for the
      'request_kid' parameter in the external_aad structure (see
      Section 13.7 4.3).

   *  The client MUST use the stored value of [RFC8613] the 'kid context'
      parameter from the original Observe request (see Section 8.1.1),
      as part of value for the
   "CoRE Parameters" registry.

 +--------------+------------+-----------------------------+-----------+
 | Bit Position |    Name    |         Description         | Reference |
 +--------------+------------+-----------------------------+-----------+
 |       2      | Group Flag | For 'request_kid_context' parameter in the
      external_aad structure (see Section 4.3).

   This ensures that the client can correctly verify notifications, even
   in case it is individually rekeyed and starts using a new Sender ID
   received from the Group OSCORE    | [This     |
 |              |            | Manager (see Section 2.5.3.1), as well as
   when it installs a new Security Context, set to 1  | Document] |
 |              |            | if the message is protected |           |
 |              |            | Context with the a new ID Context (Gid)
   following a group mode         |           |
 +--------------+------------+-----------------------------+-----------+

12.  References

12.1.  Normative References

   [COSE.Algorithms]
              IANA, "COSE Algorithms",
              <https://www.iana.org/assignments/cose/
              cose.xhtml#algorithms>.

   [COSE.Key.Types]
              IANA, "COSE Key Types",
              <https://www.iana.org/assignments/cose/cose.xhtml#key-
              type>.

   [I-D.ietf-core-groupcomm-bis]
              Dijk, E., Wang, C., rekeying (see Section 3.2).

   *  The ordering and M. Tiloca, "Group Communication
              for the Constrained Application Protocol (CoAP)", draft-
              ietf-core-groupcomm-bis-03 (work in progress), February
              2021.

   [I-D.ietf-cose-countersign]
              Schaad, J. and R. Housley, "CBOR Object Signing and
              Encryption (COSE): Countersignatures", draft-ietf-cose-
              countersign-02 (work in progress), December 2020.

   [I-D.ietf-cose-rfc8152bis-algs]
              Schaad, J., "CBOR Object Signing and Encryption (COSE):
              Initial Algorithms", draft-ietf-cose-rfc8152bis-algs-12
              (work in progress), September 2020.

   [I-D.ietf-cose-rfc8152bis-struct]
              Schaad, J., "CBOR Object Signing and Encryption (COSE):
              Structures replay protection of notifications received
      from a server are performed as per Sections 4.1.3.5.2 and Process", draft-ietf-cose-rfc8152bis-
              struct-15 (work 7.4.1 of
      [RFC8613], by using the Notification Number associated to that
      server for the observation in progress), February 2021.

   [NIST-800-56A]
              Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R.
              Davis, "Recommendation question.  In addition, the client
      performs the following actions for Pair-Wise Key-Establishment
              Schemes Using Discrete Logarithm Cryptography each ongoing observation.

      - NIST
              Special Publication 800-56A, Revision 3", April 2018,
              <https://nvlpubs.nist.gov/nistpubs/SpecialPublications/
              NIST.SP.800-56Ar3.pdf>.

   [RFC2119]  Bradner, S., "Key words  When receiving the first valid notification from a server, the
         client MUST store the current kid "kid1" of that server for use the
         observation in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC4086]  Eastlake 3rd, D., Schiller, J., and S. Crocker,
              "Randomness Requirements for Security", BCP 106, RFC 4086,
              DOI 10.17487/RFC4086, June 2005,
              <https://www.rfc-editor.org/info/rfc4086>.

   [RFC7252]  Shelby, Z., Hartke, K., question.  If the 'kid' field is included in the
         OSCORE option of the notification, its value specifies "kid1".
         If the Observe request was protected in pairwise mode (see
         Section 9.3), the 'kid' field may not be present in the OSCORE
         option of the notification (see Section 4.2).  In this case,
         the client assumes "kid1" to be the Recipient ID for the server
         to which the Observe request was intended for.

      -  When receiving another valid notification from the same server
         - which can be identified and recognized through the same
         public key used to verify the countersignature - the client
         determines the current kid "kid2" of the server as above for
         "kid1", and MUST check whether "kid2" is equal to the stored
         "kid1".  If "kid1" and "kid2" are different, the client MUST
         cancel or re-register the observation in question.

         Note that, if "kid2" is different from "kid1" and the 'kid'
         field is omitted from the notification - which is possible if
         the Observe request was protected in pairwise mode - then the
         client will compute a wrong keystream to decrypt the
         countersignature (i.e., by using "kid1" rather than "kid2" in
         the 'id' field of the 'info' array in Section 4.1.1), thus
         subsequently failing to verify the countersignature and
         discarding the notification.

   This ensures that the client remains able to correctly perform the
   ordering and replay protection of notifications, even in case a
   server legitimately starts using a new Sender ID, as received from
   the Group Manager when individually rekeyed (see Section 2.5.3.1) or
   when re-joining the group.

8.5.  External Signature Checkers

   When receiving a message protected in group mode, a signature checker
   (see Section 3.1) proceeds as follows.

   *  The signature checker retrieves the encrypted countersignature
      ENC_SIGNATURE from the message payload, and computes the original
      countersignature SIGNATURE as

      SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM

      where KEYSTREAM is derived as per Section 4.1.1.

   *  The signature checker verifies the original countersignature
      SIGNATURE, by using the public key of the sender endpoint.  The
      signature checker determines the public key to use based on the ID
      Context (Gid) and the Sender ID of the sender endpoint.

   Note that the following applies when attempting to verify the
   countersignature of a response message.

   *  The response may not include a Partial IV and/or an ID Context.
      In such a case, the signature checker considers the same values
      from the corresponding request, i.e., the request matching with
      the response by CoAP Token value.

   *  The response may not include a Sender ID.  This can happen when
      the response protected in group mode matches a request protected
      in pairwise mode (see Section 9.1), with a case in point provided
      by [I-D.amsuess-core-cachable-oscore].  In such a case, the
      signature checker needs to use other means (e.g., source
      addressing information of the server endpoint) to identify the
      correct public key to use for verifying the countersignature of
      the response.

   The particular actions following a successful or unsuccessful
   verification of the countersignature are application specific and out
   of the scope of this document.

9.  Message Processing in Pairwise Mode

   When using the pairwise mode of Group OSCORE, messages are protected
   and processed as in [RFC8613], with the modifications described in
   this section.  The security objectives of the pairwise mode are
   discussed in Appendix A.2.

   The pairwise mode takes advantage of an existing Security Context for
   the group mode to establish a Security Context shared exclusively
   with any other member.  In order to use the pairwise mode in a group
   that uses also the group mode, the signature scheme of the group mode
   MUST support a combined signature and encryption scheme.  This can
   be, for example, signature using ECDSA, and encryption using AES-CCM
   with a key derived with ECDH.  For encryption and decryption
   operations, the AEAD Algorithm from the Common Context is used (see
   Section 2.1.1).

   The pairwise mode does not support the use of additional entities
   acting as verifiers of source authentication and integrity of group
   messages, such as intermediary gateways (see Section 3).

   An endpoint implementing only a silent server does not support the
   pairwise mode.

   If the signature algorithm used in the group supports ECDH (e.g.,
   ECDSA, EdDSA), the pairwise mode MUST be supported by endpoints that
   use the CoAP Echo Option [I-D.ietf-core-echo-request-tag] and/or
   block-wise transfers [RFC7959], for instance for responses after the
   first block-wise request, which possibly targets all servers in the
   group and includes the CoAP Block2 option (see Section 3.8 of
   [I-D.ietf-core-groupcomm-bis]).  This prevents the attack described
   in Section 10.9, which leverages requests sent over unicast to a
   single group member and protected with the group mode.

   Senders cannot use the pairwise mode to protect a message intended
   for multiple recipients.  In fact, the pairwise mode is defined only
   between two endpoints and the keying material is thus only available
   to one recipient.

   However, a sender can use the pairwise mode to protect a message sent
   to (but not intended for) multiple recipients, if interested in a
   response from only one of them.  For instance, this is useful to
   support the address discovery service defined in Section 9.1, when a
   single 'kid' value is indicated in the payload of a request sent to
   multiple recipients, e.g., over multicast.

   The Group Manager indicates that the group uses (also) the pairwise
   mode, as part of the group data provided to candidate group members
   when joining the group.

9.1.  Pre-Conditions

   In order to protect an outgoing message in pairwise mode, the sender
   needs to know the public key and the Recipient ID for the recipient
   endpoint, as stored in the Recipient Context associated to that
   endpoint (see Section 2.4.4).

   Furthermore, the sender needs to know the individual address of the
   recipient endpoint.  This information may not be known at any given
   point in time.  For instance, right after having joined the group, a
   client may know the public key and Recipient ID for a given server,
   but not the addressing information required to reach it with an
   individual, one-to-one request.

   To make addressing information of individual endpoints available,
   servers in the group MAY expose a resource to which a client can send
   a group request targeting a set of servers, identified by their 'kid'
   values specified in the request payload.  The specified set may be
   empty, hence identifying all the servers in the group.  Further
   details of such an interface are out of scope for this document.

9.2.  Main Differences from OSCORE

   The pairwise mode protects messages between two members of a group,
   essentially following [RFC8613], but with the following notable
   differences.

   *  The 'kid' and 'kid context' parameters of the COSE object are used
      as defined in Section 4.2 of this document.

   *  The external_aad defined in Section 4.3 of this document is used
      for the encryption process.

   *  The Pairwise Sender/Recipient Keys used as Sender/Recipient keys
      are derived as defined in Section 2.4 of this document.

9.3.  Protecting the Request

   When using the pairwise mode, the request is protected as defined in
   Section 8.1 of [RFC8613], with the differences summarized in
   Section 9.2 of this document.  The following difference also applies.

   *  If Observe [RFC7641] is supported, what defined in Section 8.1.1
      of this document holds.

9.4.  Verifying the Request

   Upon receiving a request with the Group Flag set to 0, following the
   procedure in Section 7, the server MUST process it as defined in
   Section 8.2 of [RFC8613], with the differences summarized in
   Section 9.2 of this document.  The following differences also apply.

   *  If the server discards the request due to not retrieving a
      Security Context associated to the OSCORE group or to not
      supporting the pairwise mode, the server MAY respond with a 4.01
      (Unauthorized) error message or a 4.02 (Bad Option) error message,
      respectively.  When doing so, the server MAY set an Outer Max-Age
      option with value zero, and MAY include a descriptive string as
      diagnostic payload.

   *  If a new Recipient Context is created for this Recipient ID, new
      Pairwise Sender/Recipient Keys are also derived (see
      Section 2.4.1).  The new Pairwise Sender/Recipient Keys are
      deleted if the Recipient Context is deleted as a result of the
      message not being successfully verified.

   *  If Observe [RFC7641] is supported, what defined in Section 8.2.1
      of this document holds.

9.5.  Protecting the Response

   When using the pairwise mode, a response is protected as defined in
   Section 8.3 of [RFC8613], with the differences summarized in
   Section 9.2 of this document.  The following differences also apply.

   *  If the server is using a different Security Context for the
      response compared to what was used to verify the request (see
      Section 3.2), then the server MUST include its Sender Sequence
      Number as Partial IV in the response and use it to build the AEAD
      nonce to protect the response.  This prevents the AEAD nonce from
      the request from being reused.

   *  If the server is using a different ID Context (Gid) for the
      response compared to what was used to verify the request (see
      Section 3.2), then the new ID Context MUST be included in the 'kid
      context' parameter of the response.

   *  The server can obtain a new Sender ID from the Group Manager, when
      individually rekeyed (see Section 2.5.3.1) or when re-joining the
      group.  In such a case, the server can help the client to
      synchronize, by including the 'kid' parameter in a response
      protected in pairwise mode, even when the request was also
      protected in pairwise mode.

      That is, when responding to a request protected in pairwise mode,
      the server SHOULD include the 'kid' parameter in a response
      protected in pairwise mode, if it is replying to that client for
      the first time since the assignment of its new Sender ID.

   *  If Observe [RFC7641] is supported, what defined in Section 8.3.1
      of this document holds.

9.6.  Verifying the Response

   Upon receiving a response with the Group Flag set to 0, following the
   procedure in Section 7, the client MUST process it as defined in
   Section 8.4 of [RFC8613], with the differences summarized in
   Section 9.2 of this document.  The following differences also apply.

   *  The client may receive a response protected with a Security
      Context different from the one used to protect the corresponding
      request.  Also, upon the establishment of a new Security Context,
      the client re-initializes its Replay Windows in its Recipient
      Contexts (see Section 3.2).

   *  The same as described in Section 8.4 holds with respect to
      handling the 'kid' parameter of the response, when received as a
      reply to a request protected in pairwise mode.  The client can
      also in this case check whether the replying server is the
      expected one, by relying on the server's public key.  However,
      since the response is protected in pairwise mode, the public key
      is not used for verifying a countersignature as in Section 8.4,
      but rather as input to derive the Pairwise Recipient Key used to
      decrypt and verify the response (see Section 2.4.1).

   *  If a new Recipient Context is created for this Recipient ID, new
      Pairwise Sender/Recipient Keys are also derived (see
      Section 2.4.1).  The new Pairwise Sender/Recipient Keys are
      deleted if the Recipient Context is deleted as a result of the
      message not being successfully verified.

   *  If Observe [RFC7641] is supported, what defined in Section 8.4.1
      of this document holds.  The client can also in this case identify
      a server to be the same one across a change of Sender ID, by
      relying on the server's public key.  However, since the
      notification is protected in pairwise mode, the public key is not
      used for verifying a countersignature as in Section 8.4, but
      rather as input to derive the Pairwise Recipient Key used to
      decrypt and verify the notification (see Section 2.4.1).

10.  Security Considerations

   The same threat model discussed for OSCORE in Appendix D.1 of
   [RFC8613] holds for Group OSCORE.  In addition, when using the group
   mode, source authentication of messages is explicitly ensured by
   means of countersignatures, as discussed in Section 10.1.

   Note that, even if an endpoint is authorized to be a group member and
   to take part in group communications, there is a risk that it behaves
   inappropriately.  For instance, it can forward the content of
   messages in the group to unauthorized entities.  However, in many use
   cases, the devices in the group belong to a common authority and are
   configured by a commissioner (see Appendix B), which results in a
   practically limited risk and enables a prompt detection/reaction in
   case of misbehaving.

   The same considerations on supporting Proxy operations discussed for
   OSCORE in Appendix D.2 of [RFC8613] hold for Group OSCORE.

   The same considerations on protected message fields for OSCORE
   discussed in Appendix D.3 of [RFC8613] hold for Group OSCORE.

   The same considerations on uniqueness of (key, nonce) pairs for
   OSCORE discussed in Appendix D.4 of [RFC8613] hold for Group OSCORE.
   This is further discussed in Section 10.3 of this document.

   The same considerations on unprotected message fields for OSCORE
   discussed in Appendix D.5 of [RFC8613] hold for Group OSCORE, with
   the following differences.  First, the 'kid context' of request
   messages is part of the Additional Authenticated Data, thus safely
   enabling to keep observations active beyond a possible change of ID
   Context (Gid), following a group rekeying (see Section 4.3).  Second,
   the countersignature included in a Group OSCORE message protected in
   group mode is computed also over the value of the OSCORE option,
   which is also part of the Additional Authenticated Data used in the
   signing process.  This is further discussed in Section 10.7 of this
   document.

   As discussed in Section 6.2.3 of [I-D.ietf-core-groupcomm-bis], Group
   OSCORE addresses security attacks against CoAP listed in Sections
   11.2-11.6 of [RFC7252], especially when run over IP multicast.

   The rest of this section first discusses security aspects to be taken
   into account when using Group OSCORE.  Then it goes through aspects
   covered in the security considerations of OSCORE (see Section 12 of
   [RFC8613]), and discusses how they hold when Group OSCORE is used.

10.1.  Security of the Group Mode

   The group mode defined in Section 8 relies on commonly shared group
   keying material to protect communication within a group.  Using the
   group mode has the implications discussed below.  The following
   refers to group members as the endpoints in the group owning the
   latest version of the group keying material.

   *  Messages are encrypted at a group level (group-level data
      confidentiality), i.e., they can be decrypted by any member of the
      group, but not by an external adversary or other external
      entities.

   *  If the used encryption algorithm provides integrity protection,
      then it also ensures group authentication and proof of group
      membership, but not source authentication.  That is, it ensures
      that a message sent to a group has been sent by a member of that
      group, but not necessarily by the alleged sender.  In fact, any
      group member is able to derive the Sender Key used by the actual
      sender endpoint, and thus can compute a valid authentication tag.
      Therefore, the message content could originate from any of the
      current group members.

      Furthermore, if the used encryption algorithm does not provide
      integrity protection, then it does not ensure any level of message
      authentication or proof of group membership.

      On the other hand, proof of group membership is always ensured by
      construction through the strict management of the group keying
      material (see Section 3.2).  That is, the group is rekeyed in case
      of nodes' leaving, and the current group members are informed of
      former group members.  Thus, a current group member owning the
      latest group keying material does not own the public key of any
      former group member.

      This allows a recipient endpoint to rely on the owned public keys,
      in order to always confidently assert the group membership of a
      sender endpoint when processing an incoming message, i.e., to
      assert that the sender endpoint was a group member when it signed
      the message.  In turn, this prevents a former group member to
      possibly re-sign and inject in the group a stored message that was
      protected with old keying material.

   *  Source authentication of messages sent to a group is ensured
      through a countersignature, which is computed by the sender using
      its own private key and then appended to the message payload.
      Also, the countersignature is encrypted by using a keystream
      derived from the group keying material (see Section 4.1).  This
      ensures group privacy, i.e., an attacker cannot track an endpoint
      over two groups by linking messages between the two groups, unless
      being also a member of those groups.

   The security properties of the group mode are summarized below.

   1.  Asymmetric source authentication, by means of a countersignature.

   2.  Symmetric group authentication, by means of an authentication tag
       (only for encryption algorithms providing integrity protection).

   3.  Symmetric group confidentiality, by means of symmetric
       encryption.

   4.  Proof of group membership, by strictly managing the group keying
       material, as well as by means of integrity tags when using an
       encryption algorithm that provides also integrity protection.

   5.  Group privacy, by encrypting the countersignature.

   The group mode fulfills the security properties above while also
   displaying the following benefits.  First, the use of encryption
   algorithm that does not provide integrity protection results in a
   minimal communication overhead, by limiting the message payload to
   the ciphertext and the encrypted countersignature.  Second, it is
   possible to deploy semi-trusted principals such as signature checkers
   (see Section 3.1), which can break property 5, but cannot break
   properties 1, 2 and 3.

10.2.  Security of the Pairwise Mode

   The pairwise mode defined in Section 9 protects messages by using
   pairwise symmetric keys, derived from the static-static Diffie-
   Hellman shared secret computed from the asymmetric keys of the sender
   and recipient endpoint (see Section 2.4).

   The used encryption algorithm MUST provide integrity protection.
   Therefore, the pairwise mode ensures both pairwise data-
   confidentiality and source authentication of messages, without using
   countersignatures.  Furthermore, the recipient endpoint achieves
   proof of group membership for the sender endpoint, since only current
   group members have the required keying material to derive a valid
   Pairwise Sender/Recipient Key.

   The long-term storing of the Diffie-Hellman shared secret is a
   potential security issue.  In fact, if the shared secret of two group
   members is leaked, a third group member can exploit it to impersonate
   any of those two group members, by deriving and using their pairwise
   key.  The possibility of such leakage should be contemplated, as more
   likely to happen than the leakage of a private key, which could be
   rather protected at a significantly higher level than generic memory,
   e.g., by using a Trusted Platform Module.  Therefore, there is a
   trade-off between the maximum amount of time a same shared secret is
   stored and the frequency of its re-computing.

10.3.  Uniqueness of (key, nonce)

   The proof for uniqueness of (key, nonce) pairs in Appendix D.4 of
   [RFC8613] is also valid in group communication scenarios.  That is,
   given an OSCORE group:

   *  Uniqueness of Sender IDs within the group is enforced by the Group
      Manager.  In fact, from the moment when a Gid is assigned to a
      group until the moment a new Gid is assigned to that same group,
      the Group Manager does not reassign a Sender ID within the group
      (see Section 3.2).

   *  The case A in Appendix D.4 of [RFC8613] concerns all group
      requests and responses including a Partial IV (e.g., Observe
      notifications).  In this case, same considerations from [RFC8613]
      apply here as well.

   *  The case B in Appendix D.4 of [RFC8613] concerns responses not
      including a Partial IV (e.g., single response to a group request).
      In this case, same considerations from [RFC8613] apply here as
      well.

   As a consequence, each message encrypted/decrypted with the same
   Sender Key is processed by using a different (ID_PIV, PIV) pair.
   This means that nonces used by any fixed encrypting endpoint are
   unique.  Thus, each message is processed with a different (key,
   nonce) pair.

10.4.  Management of Group Keying Material

   The approach described in this document should take into account the
   risk of compromise of group members.  In particular, this document
   specifies that a key management scheme for secure revocation and
   renewal of Security Contexts and group keying material MUST be
   adopted.

   [I-D.ietf-ace-key-groupcomm-oscore] provides a simple rekeying scheme
   for renewing the Security Context in a group.

   Alternative rekeying schemes which are more scalable with the group
   size may be needed in dynamic, large-scale groups where endpoints can
   join and leave at any time, in order to limit the impact on
   performance due to the Security Context and keying material update.

10.5.  Update of Security Context and Key Rotation

   A group member can receive a message shortly after the group has been
   rekeyed, and new security parameters and keying material have been
   distributed by the Group Manager.

   This may result in a client using an old Security Context to protect
   a request, and a server using a different new Security Context to
   protect a corresponding response.  As a consequence, clients may
   receive a response protected with a Security Context different from
   the one used to protect the corresponding request.

   In particular, a server may first get a request protected with the
   old Security Context, then install the new Security Context, and only
   after that produce a response to send back to the client.  In such a
   case, as specified in Section 8.3, the server MUST protect the
   potential response using the new Security Context.  Specifically, the
   server MUST include its Sender Sequence Number as Partial IV in the
   response and use it to build the AEAD nonce to protect the response.
   This prevents the AEAD nonce from the request from being reused with
   the new Security Context.

   The client will process that response using the new Security Context,
   provided that it has installed the new security parameters and keying
   material before the message processing.

   In case block-wise transfer [RFC7959] is used, the same
   considerations from Section 9.2 of [I-D.ietf-ace-key-groupcomm] hold.

   Furthermore, as described below, a group rekeying may temporarily
   result in misaligned Security Contexts between the sender and
   recipient of a same message.

10.5.1.  Late Update on the Sender

   In this case, the sender protects a message using the old Security
   Context, i.e., before having installed the new Security Context.
   However, the recipient receives the message after having installed
   the new Security Context, and is thus unable to correctly process it.

   A possible way to ameliorate this issue is to preserve the old,
   recent, Security Context for a maximum amount of time defined by the
   application.  By doing so, the recipient can still try to process the
   received message using the old retained Security Context as a second
   attempt.  This makes particular sense when the recipient is a client,
   that would hence be able to process incoming responses protected with
   the old, recent, Security Context used to protect the associated
   group request.  Instead, a recipient server would better and more
   simply discard an incoming group request which is not successfully
   processed with the new Security Context.

   This tolerance preserves the processing of secure messages throughout
   a long-lasting key rotation, as group rekeying processes may likely
   take a long time to complete, especially in large scale groups.  On
   the other hand, a former (compromised) group member can abusively
   take advantage of this, and send messages protected with the old
   retained Security Context.  Therefore, a conservative application
   policy should not admit the retention of old Security Contexts.

10.5.2.  Late Update on the Recipient

   In this case, the sender protects a message using the new Security
   Context, but the recipient receives that message before having
   installed the new Security Context.  Therefore, the recipient would
   not be able to correctly process the message and hence discards it.

   If the recipient installs the new Security Context shortly after that
   and the sender endpoint retransmits the message, the former will
   still be able to receive and correctly process the message.

   In any case, the recipient should actively ask the Group Manager for
   an updated Security Context according to an application-defined
   policy, for instance after a given number of unsuccessfully decrypted
   incoming messages.

10.6.  Collision of Group Identifiers

   In case endpoints are deployed in multiple groups managed by
   different non-synchronized Group Managers, it is possible for Group
   Identifiers of different groups to coincide.

   This does not impair the security of the AEAD algorithm.  In fact, as
   long as the Master Secret is different for different groups and this
   condition holds over time, AEAD keys are different among different
   groups.

   The entity assigning an IP multicast address may help limiting the
   chances to experience such collisions of Group Identifiers.  In
   particular, it may allow the Group Managers of groups using the same
   IP multicast address to share their respective list of assigned Group
   Identifiers currently in use.

10.7.  Cross-group Message Injection

   A same endpoint is allowed to and would likely use the same public/
   private key pair in multiple OSCORE groups, possibly administered by
   different Group Managers.

   When a sender endpoint sends a message protected in pairwise mode to
   a recipient endpoint in an OSCORE group, a malicious group member may
   attempt to inject the message to a different OSCORE group also
   including the same endpoints (see Section 10.7.1).

   This practically relies on altering the content of the OSCORE option,
   and having the same MAC in the ciphertext still correctly validating,
   which has a success probability depending on the size of the MAC.

   As discussed in Section 10.7.2, the attack is practically infeasible
   if the message is protected in group mode, thanks to the
   countersignature also bound to the OSCORE option through the
   Additional Authenticated Data used in the signing process (see
   Section 4.3).

10.7.1.  Attack Description

   Let us consider:

   *  Two OSCORE groups G1 and G2, with ID Context (Group ID) Gid1 and
      Gid2, respectively.  Both G1 and G2 use the AEAD cipher AES-CCM-
      16-64-128, i.e., the MAC of the ciphertext is 8 bytes in size.

   *  A sender endpoint X which is member of both G1 and G2, and uses
      the same public/private key pair in both groups.  The endpoint X
      has Sender ID Sid1 in G1 and Sender ID Sid2 in G2.  The pairs
      (Sid1, Gid1) and (Sid2, Gid2) identify the same public key of X in
      G1 and G2, respectively.

   *  A recipient endpoint Y which is member of both G1 and G2, and uses
      the same public/private key pair in both groups.  The endpoint Y
      has Sender ID Sid3 in G1 and Sender ID Sid4 in G2.  The pairs
      (Sid3, Gid1) and (Sid4, Gid2) identify the same public key of Y in
      G1 and G2, respectively.

   *  A malicious endpoint Z is also member of both G1 and G2.  Hence, Z
      is able to derive the Sender Keys used by X in G1 and G2.

   When X sends a message M1 addressed to Y in G1 and protected in
   pairwise mode, Z can intercept M1, and attempt to forge a valid
   message M2 to be injected in G2, making it appear as still sent by X
   to Y and valid to be accepted.

   More in detail, Z intercepts and stops message M1, and forges a
   message M2 by changing the value of the OSCORE option from M1 as
   follows: the 'kid context' is set to G2 (rather than G1); and the
   'kid' is set to Sid2 (rather than Sid1).  Then, Z injects message M2
   as addressed to Y in G2.

   Upon receiving M2, there is a probability equal to 2^-64 that Y
   successfully verifies the same unchanged MAC by using the Pairwise
   Recipient Key associated to X in G2.

   Note that Z does not know the pairwise keys of X and Y, since it does
   not know and is not able to compute their shared Diffie-Hellman
   secret.  Therefore, Z is not able to check offline if a performed
   forgery is actually valid, before sending the forged message to G2.

10.7.2.  Attack Prevention in Group Mode

   When a Group OSCORE message is protected with the group mode, the
   countersignature is computed also over the value of the OSCORE
   option, which is part of the Additional Authenticated Data used in
   the signing process (see Section 4.3).

   That is, other than over the ciphertext, the countersignature is
   computed over: the ID Context (Gid) and the Partial IV, which are
   always present in group requests; as well as the Sender ID of the
   message originator, which is always present in group requests as well
   as in responses to requests protected in group mode.

   Since the signing process takes as input also the ciphertext of the
   COSE_Encrypt0 object, the countersignature is bound not only to the
   intended OSCORE group, hence to the triplet (Master Secret, Master
   Salt, ID Context), but also to a specific Sender ID in that group and
   to its specific symmetric key used for AEAD encryption, hence to the
   quartet (Master Secret, Master Salt, ID Context, Sender ID).

   This makes it practically infeasible to perform the attack described
   in Section 10.7.1, since it would require the adversary to
   additionally forge a valid countersignature that replaces the
   original one in the forged message M2.

   If the countersignature did not cover the OSCORE option, the attack
   would still be possible against response messages protected in group
   mode, since the same unchanged countersignature from message M1 would
   be also valid in message M2.

   Also, the following attack simplifications would hold, since Z is
   able to derive the Sender/Recipient Keys of X and Y in G1 and G2.
   That is, Z can also set a convenient Partial IV in the response,
   until the same unchanged MAC is successfully verified by using G2 as
   'request_kid_context', Sid2 as 'request_kid', and the symmetric key
   associated to X in G2.

   Since the Partial IV is 5 bytes in size, this requires 2^40
   operations to test all the Partial IVs, which can be done in real-
   time.  The probability that a single given message M1 can be used to
   forge a response M2 for a given request would be equal to 2^-24,
   since there are more MAC values (8 bytes in size) than Partial IV
   values (5 bytes in size).

   Note that, by changing the Partial IV as discussed above, any member
   of G1 would also be able to forge a valid signed response message M2
   to be injected in the same group G1.

10.8.  Prevention of Group Cloning Attack

   Both when using the group mode and the pairwise mode, the message
   protection covers also the Group Manager's public key.  This public
   key is included in the Additional Authenticated Data used in the
   signing process and/or in the integrity-protected encryption process
   (see Section 4.3).

   By doing so, an endpoint X member of a group G1 cannot perform the
   following attack.

   1.  X sets up a group G2 where it acts as Group Manager.

   2.  X makes G2 a "clone" of G1, i.e., G1 and G2 use the same
       algorithms and have the same Master Secret, Master Salt and ID
       Context.

   3.  X collects a message M sent to G1 and injects it in G2.

   4.  Members of G2 accept M and believe it to be originated in G2.

   The attack above is effectively prevented, since message M is
   protected by including the public key of G1's Group Manager in the
   Additional Authenticated Data.  Therefore, members of G2 do not
   successfully verify and decrypt M, since they correctly use the
   public key of X as Group Manager of G2 when attempting to.

10.9.  Group OSCORE for Unicast Requests

   If a request is intended to be sent over unicast as addressed to a
   single group member, it is NOT RECOMMENDED for the client to protect
   the request by using the group mode as defined in Section 8.1.

   This does not include the case where the client sends a request over
   unicast to a proxy, to be forwarded to multiple intended recipients
   over multicast [I-D.ietf-core-groupcomm-bis].  In this case, the
   client MUST protect the request with the group mode, even though it
   is sent to the proxy over unicast (see Section 8).

   If the client uses the group mode with its own Sender Key to protect
   a unicast request to a group member, an on-path adversary can, right
   then or later on, redirect that request to one/many different group
   member(s) over unicast, or to the whole OSCORE group over multicast.
   By doing so, the adversary can induce the target group member(s) to
   perform actions intended for one group member only.  Note that the
   adversary can be external, i.e., (s)he does not need to also be a
   member of the OSCORE group.

   This is due to the fact that the client is not able to indicate the
   single intended recipient in a way which is secure and C. Bormann, "The Constrained
              Application Protocol (CoAP)", RFC 7252,
              DOI 10.17487/RFC7252, June 2014,
              <https://www.rfc-editor.org/info/rfc7252>.

   [RFC7748]  Langley, A., Hamburg, M., possible to
   process for Group OSCORE on the server side.  In particular, Group
   OSCORE does not protect network addressing information such as the IP
   address of the intended recipient server.  It follows that the
   server(s) receiving the redirected request cannot assert whether that
   was the original intention of the client, and would thus simply
   assume so.

   The impact of such an attack depends especially on the REST method of
   the request, i.e., the Inner CoAP Code of the OSCORE request message.
   In particular, safe methods such as GET and FETCH would trigger
   (several) unintended responses from the targeted server(s), while not
   resulting in destructive behavior.  On the other hand, non safe
   methods such as PUT, POST and S. Turner, "Elliptic Curves
              for Security", RFC 7748, DOI 10.17487/RFC7748, January
              2016, <https://www.rfc-editor.org/info/rfc7748>.

   [RFC8032]  Josefsson, S. PATCH/iPATCH would result in the target
   server(s) taking active actions on their resources and I. Liusvaara, "Edwards-Curve Digital
              Signature Algorithm (EdDSA)", RFC 8032,
              DOI 10.17487/RFC8032, January 2017,
              <https://www.rfc-editor.org/info/rfc8032>.

   [RFC8174]  Leiba, B., "Ambiguity possible
   cyber-physical environment, with the risk of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8613]  Selander, G., Mattsson, J., Palombini, F., destructive consequences
   and L. Seitz,
              "Object Security possible implications for Constrained RESTful Environments
              (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019,
              <https://www.rfc-editor.org/info/rfc8613>.

   [RFC8949]  Bormann, C. and P. Hoffman, "Concise Binary Object
              Representation (CBOR)", STD 94, RFC 8949,
              DOI 10.17487/RFC8949, December 2020,
              <https://www.rfc-editor.org/info/rfc8949>.

12.2.  Informative References

   [Degabriele]
              Degabriele, J., Lehmann, A., Paterson, K., Smart, N., safety.

   A client can instead use the pairwise mode as defined in Section 9.3,
   in order to protect a request sent to a single group member by using
   pairwise keying material (see Section 2.4).  This prevents the attack
   discussed above by construction, as only the intended server is able
   to derive the pairwise keying material used by the client to protect
   the request.  A client supporting the pairwise mode SHOULD use it to
   protect requests sent to a single group member over unicast, instead
   of using the group mode.  For an example where this is not fulfilled,
   see Sections 7.2.1 and
              M. Strefler, "On 7.2.4 of
   [I-D.ietf-core-observe-multicast-notifications].

   With particular reference to block-wise transfers [RFC7959],
   Section 3.8 of [I-D.ietf-core-groupcomm-bis] points out that, while
   an initial request including the CoAP Block2 option can be sent over
   multicast, any other request in a transfer has to occur over unicast,
   individually addressing the Joint Security of Encryption and
              Signature servers in EMV", December 2011,
              <https://eprint.iacr.org/2011/615>.

   [I-D.ietf-ace-key-groupcomm]
              Palombini, F. and M. Tiloca, "Key Provisioning the group.

   Additional considerations are discussed in Appendix E, with respect
   to requests including a CoAP Echo Option
   [I-D.ietf-core-echo-request-tag] that has to be sent over unicast, as
   a challenge-response method for servers to achieve synchronization of
   clients' Sender Sequence Number.

10.10.  End-to-end Protection

   The same considerations from Section 12.1 of [RFC8613] hold for Group
              Communication using ACE", draft-ietf-ace-key-groupcomm-11
              (work in progress), February 2021.

   [I-D.ietf-ace-key-groupcomm-oscore]
              Tiloca, M., Park, J.,
   OSCORE.

   Additionally, (D)TLS and F. Palombini, "Key Management
              for Group OSCORE Groups in ACE", draft-ietf-ace-key-groupcomm-
              oscore-10 (work in progress), February 2021.

   [I-D.ietf-ace-oauth-authz]
              Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and
              H. Tschofenig, "Authentication can be combined for protecting
   message exchanges occurring over unicast.  However, it is not
   possible to combine (D)TLS and Authorization Group OSCORE for
              Constrained Environments (ACE) protecting message
   exchanges where messages are (also) sent over multicast.

10.11.  Master Secret

   Group OSCORE derives the Security Context using the OAuth 2.0
              Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-37
              (work in progress), February 2021.

   [I-D.ietf-core-echo-request-tag]
              Amsuess, C., Mattsson, J., and G. Selander, "CoAP: Echo,
              Request-Tag, same construction
   as OSCORE, and Token Processing", draft-ietf-core-echo-
              request-tag-12 (work in progress), January 2021.

   [I-D.ietf-lwig-curve-representations]
              Struik, R., "Alternative Elliptic Curve Representations",
              draft-ietf-lwig-curve-representations-20 (work by using the Group Identifier of a group as the
   related ID Context.  Hence, the same required properties of the
   Security Context parameters discussed in
              progress), February 2021.

   [I-D.ietf-lwig-security-protocol-comparison]
              Mattsson, J., Palombini, F., and M. Vucinic, "Comparison Section 3.3 of [RFC8613]
   hold for this document.

   With particular reference to the OSCORE Master Secret, it has to be
   kept secret among the members of CoAP Security Protocols", draft-ietf-lwig-security-
              protocol-comparison-05 (work in progress), November 2020.

   [I-D.ietf-tls-dtls13]
              Rescorla, E., Tschofenig, H., and N. Modadugu, "The
              Datagram Transport Layer Security (DTLS) Protocol Version
              1.3", draft-ietf-tls-dtls13-41 (work in progress),
              February 2021.

   [I-D.mattsson-cfrg-det-sigs-with-noise]
              Mattsson, J., Thormarker, E., the respective OSCORE group and S. Ruohomaa,
              "Deterministic ECDSA the
   Group Manager responsible for that group.  Also, the Master Secret
   must have a good amount of randomness, and EdDSA Signatures with Additional
              Randomness", draft-mattsson-cfrg-det-sigs-with-noise-02
              (work in progress), March 2020.

   [I-D.somaraju-ace-multicast]
              Somaraju, A., Kumar, S., Tschofenig, H., the Group Manager can
   generate it offline using a good random number generator.  This
   includes the case where the Group Manager rekeys the group by
   generating and W. Werner,
              "Security distributing a new Master Secret.  Randomness
   requirements for Low-Latency Group Communication", draft-
              somaraju-ace-multicast-02 (work security are described in progress), October
              2016.

   [I-D.tiloca-core-observe-multicast-notifications]
              Tiloca, M., Hoeglund, R., Amsuess, C., and F. Palombini,
              "Observe Notifications as CoAP Multicast Responses",
              draft-tiloca-core-observe-multicast-notifications-05 (work [RFC4086].

10.12.  Replay Protection

   As in progress), February 2021.

   [RFC4944]  Montenegro, G., Kushalnagar, N., Hui, J., OSCORE [RFC8613], also Group OSCORE relies on Sender Sequence
   Numbers included in the COSE message field 'Partial IV' and D. Culler,
              "Transmission used to
   build AEAD nonces.

   Note that the Partial IV of IPv6 Packets over IEEE 802.15.4
              Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007,
              <https://www.rfc-editor.org/info/rfc4944>.

   [RFC4949]  Shirey, R., "Internet Security Glossary, Version 2",
              FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007,
              <https://www.rfc-editor.org/info/rfc4949>.

   [RFC6282]  Hui, J., Ed. and P. Thubert, "Compression Format for IPv6
              Datagrams over IEEE 802.15.4-Based Networks", RFC 6282,
              DOI 10.17487/RFC6282, September 2011,
              <https://www.rfc-editor.org/info/rfc6282>.

   [RFC6347]  Rescorla, E. an endpoint does not necessarily grow
   monotonically.  For instance, upon exhaustion of the endpoint Sender
   Sequence Number, the Partial IV also gets exhausted.  As discussed in
   Section 2.5.3, this results either in the endpoint being individually
   rekeyed and N. Modadugu, "Datagram Transport Layer getting a new Sender ID, or in the establishment of a new
   Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
              January 2012, <https://www.rfc-editor.org/info/rfc6347>.

   [RFC7228]  Bormann, C., Ersue, M., and A. Keranen, "Terminology for
              Constrained-Node Networks", RFC 7228,
              DOI 10.17487/RFC7228, May 2014,
              <https://www.rfc-editor.org/info/rfc7228>.

   [RFC7641]  Hartke, K., "Observing Resources Context in the Constrained
              Application Protocol (CoAP)", RFC 7641,
              DOI 10.17487/RFC7641, September 2015,
              <https://www.rfc-editor.org/info/rfc7641>.

   [RFC7959]  Bormann, C. group.  Therefore, uniqueness of (key, nonce)
   pairs (see Section 10.3) is preserved also when a new Security
   Context is established.

   Since one-to-many communication such as multicast usually involves
   unreliable transports, the simplification of the Replay Window to a
   size of 1 suggested in Section 7.4 of [RFC8613] is not viable with
   Group OSCORE, unless exchanges in the group rely only on unicast
   messages.

   As discussed in Section 6.2, a Replay Window may be initialized as
   not valid, following the loss of mutable Security Context
   Section 2.5.1.  In particular, Section 2.5.1.1 and Z. Shelby, Ed., "Block-Wise Transfers Section 2.5.1.2
   define measures that endpoints need to take in such a situation,
   before resuming to accept incoming messages from other group members.

10.13.  Message Freshness

   As discussed in Section 6.3, a server may not be able to assert
   whether an incoming request is fresh, in case it does not have or has
   lost synchronization with the Constrained Application Protocol (CoAP)", RFC 7959,
              DOI 10.17487/RFC7959, August 2016,
              <https://www.rfc-editor.org/info/rfc7959>. client's Sender Sequence Number.

   If freshness is relevant for the application, the server may
   (re-)synchronize with the client's Sender Sequence Number at any
   time, by using the approach described in Appendix A.  Assumptions E and Security Objectives

   This section presents based on the
   CoAP Echo Option [I-D.ietf-core-echo-request-tag], as a set variant of assumptions and security objectives
   for
   the approach described defined in this document.  The rest Appendix B.1.2 of this
   section refers [RFC8613] applicable to three types
   Group OSCORE.

10.14.  Client Aliveness

   Building on Section 12.5 of groups:

   o  Application group, i.e. [RFC8613], a set of server may use the CoAP endpoints Echo
   Option [I-D.ietf-core-echo-request-tag] to verify the aliveness of
   the client that share originated a
      common pool received request, by using the approach
   described in Appendix E of resources.

   o  Security group, as defined this document.

10.15.  Cryptographic Considerations

   The same considerations from Section 12.6 of [RFC8613] about the
   maximum Sender Sequence Number hold for Group OSCORE.

   As discussed in Section 1.1 2.5.2, an endpoint that experiences an
   exhaustion of this specification.
      There can be a one-to-one or its own Sender Sequence Numbers MUST NOT protect
   further messages including a one-to-many relation between
      security groups and application groups, and vice versa.

   o  CoAP group, i.e. Partial IV, until it has derived a set of CoAP endpoints where each new
   Sender Context.  This prevents the endpoint is
      configured to receive one-to-many CoAP requests, e.g. sent reuse the same AEAD
   nonces with the same Sender Key.

   In order to renew its own Sender Context, the
      group's associated IP multicast address and UDP port as defined in
      [I-D.ietf-core-groupcomm-bis].  An endpoint may be a member of
      multiple CoAP groups.  There SHOULD inform
   the Group Manager, which can be a one-to-one or a one-to-many
      relation between application groups and CoAP groups.  Note that a
      device sending a CoAP request to a CoAP group is not necessarily
      itself a member either renew the whole Security Context
   by means of that group: it is a member group rekeying, or provide only if it also has that endpoint with a CoAP server new
   Sender ID value.  In either case, the endpoint listening to requests derives a new Sender
   Context, and in particular a new Sender Key.

   Additionally, the same considerations from Section 12.6 of [RFC8613]
   hold for this CoAP group,
      sent to Group OSCORE, about building the associated IP multicast address AEAD nonce and port.  In order to
      provide secure group communication, all members the secrecy
   of a CoAP group as
      well as all further the Security Context parameters.

   For endpoints configured only as clients sending
      CoAP (multicast) requests to that support the CoAP group have mode, the EdDSA signature
   algorithm Ed25519 [RFC8032] is mandatory to be member of a
      security group.  There can be a one-to-one or a one-to-many
      relation between security groups and CoAP groups, and vice versa.

A.1.  Assumptions implement.  The following points group
   mode uses the "encrypt-then-sign" construction, i.e., the
   countersignature is computed over the COSE_Encrypt0 object (see
   Section 4.1).  This is motivated by enabling additional principals
   acting as signature checkers (see Section 3.1), which do not join a
   group as members but are assumed allowed to be already addressed and are out verify countersignatures of
   messages protected in group mode without being able to decrypt them
   (see Section 8.5).

   If the scope encryption algorithm used in group mode provides integrity
   protection, countersignatures of this document.

   o  Multicast communication topology: this document considers both
      1-to-N (one sender and multiple recipients) and M-to-N (multiple
      senders and multiple recipients) communication topologies.  The
      1-to-N communication topology is COSE_Encrypt0 with short
   authentication tags do not provide the security properties associated
   with the simplest group communication
      scenario that would serve same algorithm used in COSE_Sign (see Section 6 of
   [I-D.ietf-cose-countersign]).  To provide 128-bit security against
   collision attacks, the needs tag length MUST be at least 256-bits.  A
   countersignature of a typical Low-power and
      Lossy Network (LLN).  Examples COSE_Encrypt0 with AES-CCM-16-64-128 provides
   at most 32 bits of use cases integrity protection.

   For endpoints that benefit from
      secure group communication are provided support the pairwise mode, the ECDH-SS + HKDF-256
   algorithm specified in Appendix B.

      In a 1-to-N communication model, only a single client transmits
      data to Section 6.3.1 of
   [I-D.ietf-cose-rfc8152bis-algs] and the CoAP group, X25519 algorithm [RFC7748]
   are also mandatory to implement.

   Constrained IoT devices may alternatively represent Montgomery curves
   and (twisted) Edwards curves [RFC7748] in the short-Weierstrass form
   Wei25519, with which the algorithms ECDSA25519 and ECDH25519 can be
   used for signature operations and Diffie-Hellman secret calculation,
   respectively [I-D.ietf-lwig-curve-representations].

   For many constrained IoT devices, it is problematic to support more
   than one signature algorithm or multiple whole cipher suites.  As a
   consequence, some deployments using, for instance, ECDSA with NIST
   P-256 may not support the mandatory signature algorithm but that
   should not be an issue for local deployments.

   The derivation of request messages; pairwise keys defined in an
      M-to-N communication model (where M Section 2.4.1 is
   compatible with ECDSA and N do EdDSA asymmetric keys, but is not necessarily have
   compatible with RSA asymmetric keys.

   For the same value), M clients transmit data public key translation from Ed25519 (Ed448) to X25519 (X448)
   specified in Section 2.4.1, variable time methods can be used since
   the CoAP group.
      According to [I-D.ietf-core-groupcomm-bis], any possible proxy
      entity translation operates on public information.  Any byte string of
   appropriate length is accepted as a public key for X25519 (X448) in
   [RFC7748].  It is supposed therefore not necessary for security to know about validate
   the clients.  Also, every client
      expects translated public key (assuming the translation was successful).

   The security of using the same key pair for Diffie-Hellman and for
   signing (by considering the ECDH procedure in Section 2.4 as a Key
   Encapsulation Mechanism (KEM)) is able to handle multiple response messages
      associated demonstrated in [Degabriele] and
   [Thormarker].

   Applications using ECDH (except X25519 and X448) based KEM in
   Section 2.4 are assumed to verify that a same request sent to peer endpoint's public key
   is on the CoAP group.

   o  Group size: security solutions for group communication should be
      able to adequately support different expected curve and possibly large security
      groups. that the shared secret is not the point
   at infinity.  The group size KEM in [Degabriele] checks that the shared secret
   is different from the current number point at infinity, as does the procedure in
   Section 5.7.1.2 of members [NIST-800-56A] which is referenced in a
      security group.  In Section 2.4.

   Extending Theorem 2 of [Degabriele], [Thormarker] shows that the use cases mentioned same
   key pair can be used with X25519 and Ed25519 (X448 and Ed448) for the
   KEM specified in Section 2.4.  By symmetry in the KEM used in this
   document, both endpoints can consider themselves to have the
      number
   recipient role in the KEM - as discussed in Section 7 of clients (normally [Thormarker]
   - and rely on the controlling devices) is expected
      to be much smaller than mentioned proofs for the number security of servers (i.e. their key
   pairs.

   Theorem 3 in [Degabriele] shows that the controlled
      devices).  A security solution same key pair can be used
   for group communication an ECDH based KEM and ECDSA.  The KEM uses a different KDF than
   in Section 2.4, but the proof only depends on that
      supports 1 to 50 clients would be able to properly cover the group
      sizes required for most use cases KDF has
   certain required properties, which are the typical assumptions about
   HKDF, e.g., that output keys are relevant for this
      document. pseudorandom.  In order to comply
   with the assumptions of Theorem 3, received public keys MUST be
   successfully validated, see Section 5.6.2.3.4 of [NIST-800-56A].  The maximum group size
   validation MAY be performed by a trusted Group Manager.  For
   [Degabriele] to apply as it is expected written, public keys need to be in the range
   expected subgroup.  For this we rely on cofactor DH, Section 5.7.1.2
   of 2 to 100 devices.  Security groups larger than that should be
      divided into smaller independent groups.

   o  Communication with the Group Manager: an endpoint must use a
      secure dedicated channel when communicating with the Group
      Manager, also when [NIST-800-56A] which is referenced in Section 2.4.

   HashEdDSA variants of Ed25519 and Ed448 are not registered as a member used by COSE, see
   Section 2.2 of [I-D.ietf-cose-rfc8152bis-algs], and are not covered
   by the security
      group.

   o  Provisioning analysis in [Thormarker], and management of Security Contexts: a Security
      Context must hence MUST NOT be established among the members of used with the security
      group.  A secure mechanism must be
   public keys used to generate, revoke and
      (re-)distribute keying material, communication policies and
      security parameters with pairwise keys as specified in the security group. this document.

10.16.  Message Segmentation

   The actual
      provisioning and management same considerations from Section 12.7 of the Security Context is out [RFC8613] hold for Group
   OSCORE.

10.17.  Privacy Considerations

   Group OSCORE ensures end-to-end integrity protection and encryption
   of the
      scope of this document.

   o  Multicast data security ciphersuite: message payload and all members of a security
      group must agree on a ciphersuite options that are not used for proxy
   operations.  In particular, options are processed according to provide authenticity,
      integrity and confidentiality the
   same class U/I/E that they have for OSCORE.  Therefore, the same
   privacy considerations from Section 12.8 of messages [RFC8613] hold for Group
   OSCORE, with the following addition.

   *  When protecting a message in group mode, the group.  The
      ciphersuite countersignature is specified as part of the Security Context.

   o  Backward security:
      encrypted by using a new device joining keystream derived from the security group should
      not have access to any old Security Contexts used before its
      joining. keying
      material (see Section 4.1 and Section 4.1.1).  This ensures that group
      privacy.  That is, an attacker cannot track an endpoint over two
      groups by linking messages between the two groups, unless being
      also a new member of those groups.

   Furthermore, the security group is
      not able to decrypt confidential data sent before it has joined following privacy considerations hold about the security group.  The adopted key management scheme should
      ensure that
   OSCORE option, which may reveal information on the Security Context is updated to ensure backward
      confidentiality. communicating
   endpoints.

   *  The actual mechanism 'kid' parameter, which is intended to update the Security
      Context and renew the group keying material in the security group
      upon help a new member's joining has recipient
      endpoint to be defined as part of the group
      key management scheme.

   o  Forward security: entities that leave find the security group should
      not have access to any future Security Contexts or message
      exchanged within right Recipient Context, may reveal
      information about the security group after their leaving.  This
      ensures that Sender Endpoint.  When both a former member of request and
      the security group is not able to
      decrypt confidential data sent within corresponding responses include the security group anymore.
      Also, it ensures that 'kid' parameter, this may
      reveal information about both a former member is not able to send
      protected messages to client sending a request and all
      the security group anymore. possibly replying servers sending their own individual
      response.

   *  The actual
      mechanism 'kid context' parameter, which is intended to update help a recipient
      endpoint to find the right Security Context and renew Context, reveals information
      about the group
      keying material in sender endpoint.  In particular, it reveals that the security group upon
      sender endpoint is a member's leaving has
      to be defined as part member of the group key management scheme.

A.2.  Security Objectives

   The approach described a particular OSCORE group, whose
      current Group ID is indicated in this document aims at fulfilling the
   following security objectives:

   o  Data replay protection: group request messages or response
      messages replayed within the security group must be detected.

   o  Data confidentiality: messages sent within the security group
      shall be encrypted.

   o  Group-level data confidentiality: the group mode provides group-
      level data confidentiality since messages are encrypted at 'kid context' parameter.

   When receiving a group
      level, i.e. in such request, each of the recipient endpoints can
   reply with a way response that they can includes its Sender ID as 'kid' parameter.
   All these responses will be decrypted by any member
      of matchable with the security group, but not by an external adversary or other
      external entities.

   o  Pairwise data confidentiality: request through the pairwise mode especially
      provides pairwise data confidentiality, since messages are
      encrypted using pairwise keying material shared between any two
      group members, hence they can be decrypted only by
   Token.  Thus, even if these responses do not include a 'kid context'
   parameter, it becomes possible to understand that the intended
      single recipient.

   o  Source message authentication: messages sent within responder
   endpoints are in the security same group shall be authenticated.  That is, it is essential of the requester endpoint.

   Furthermore, using the mechanisms described in Appendix E to ensure
      that achieve
   Sender Sequence Number synchronization with a message is originated by client may reveal when
   a member server device goes through a reboot.  This can be mitigated by the
   server device storing the precise state of the security group in Replay Window of each
   known client on a clean shutdown.

   Finally, the first place, and mechanism described in particular by a specific, identifiable
      member Section 10.6 to prevent
   collisions of Group Identifiers from different Group Managers may
   reveal information about events in the security group.

   o  Message integrity: messages sent within respective OSCORE groups.  In
   particular, a Group Identifier changes when the security corresponding group shall
      be integrity protected.  That is, it
   is essential rekeyed.  Thus, Group Managers might use the shared list of Group
   Identifiers to ensure that a
      message has not been tampered with, either by infer the rate and patterns of group membership
   changes triggering a group member, or
      by an external adversary rekeying, e.g., due to newly joined
   members or other external entities evicted (compromised) members.  In order to alleviate this
   privacy concern, it should be hidden from the Group Managers which are not
      members
   exact Group Manager has currently assigned which Group Identifiers in
   its OSCORE groups.

11.  IANA Considerations

   Note to RFC Editor: Please replace "[This Document]" with the RFC
   number of this document and delete this paragraph.

   This document has the following actions for IANA.

11.1.  OSCORE Flag Bits Registry

   IANA is asked to add the security group.

   o  Message ordering: it must be possible following value entry to determine the ordering of
      messages coming from a single sender.  In accordance with OSCORE
      [RFC8613], this results "OSCORE Flag
   Bits" subregistry defined in providing absolute freshness Section 13.7 of
      responses that are not notifications, as well [RFC8613] as relative
      freshness part of the
   "CoRE Parameters" registry.

 +--------------+------------+-----------------------------+-----------+
 | Bit Position |    Name    |         Description         | Reference |
 +--------------+------------+-----------------------------+-----------+
 |       2      | Group Flag | For using a Group OSCORE    | [This     |
 |              |            | Security Context, set to 1  | Document] |
 |              |            | if the message is protected |           |
 |              |            | with the group requests mode         |           |
 +--------------+------------+-----------------------------+-----------+

12.  References

12.1.  Normative References

   [I-D.ietf-core-groupcomm-bis]
              Dijk, E., Wang, C., and notification responses.  It is not
      required to determine ordering of messages from different senders.

Appendix B.  List of Use Cases

   Group M. Tiloca, "Group Communication
              for CoAP [I-D.ietf-core-groupcomm-bis] provides the necessary background Constrained Application Protocol (CoAP)", Work in
              Progress, Internet-Draft, draft-ietf-core-groupcomm-bis-
              04, 12 July 2021, <https://www.ietf.org/archive/id/draft-
              ietf-core-groupcomm-bis-04.txt>.

   [I-D.ietf-cose-countersign]
              Schaad, J. and R. Housley, "CBOR Object Signing and
              Encryption (COSE): Countersignatures", Work in Progress,
              Internet-Draft, draft-ietf-cose-countersign-05, 23 June
              2021, <https://www.ietf.org/archive/id/draft-ietf-cose-
              countersign-05.txt>.

   [I-D.ietf-cose-rfc8152bis-algs]
              Schaad, J., "CBOR Object Signing and Encryption (COSE):
              Initial Algorithms", Work in Progress, Internet-Draft,
              draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020,
              <https://www.ietf.org/archive/id/draft-ietf-cose-
              rfc8152bis-algs-12.txt>.

   [I-D.ietf-cose-rfc8152bis-struct]
              Schaad, J., "CBOR Object Signing and Encryption (COSE):
              Structures and Process", Work in Progress, Internet-Draft,
              draft-ietf-cose-rfc8152bis-struct-15, 1 February 2021,
              <https://www.ietf.org/archive/id/draft-ietf-cose-
              rfc8152bis-struct-15.txt>.

   [NIST-800-56A]
              Barker, E., Chen, L., Roginsky, A., Vassilev, A., and R.
              Davis, "Recommendation for multicast-based CoAP communication, with
   particular reference Pair-Wise Key-Establishment
              Schemes Using Discrete Logarithm Cryptography - NIST
              Special Publication 800-56A, Revision 3", April 2018,
              <https://nvlpubs.nist.gov/nistpubs/SpecialPublications/
              NIST.SP.800-56Ar3.pdf>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to low-power Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC4086]  Eastlake 3rd, D., Schiller, J., and lossy networks (LLNs) S. Crocker,
              "Randomness Requirements for Security", BCP 106, RFC 4086,
              DOI 10.17487/RFC4086, June 2005,
              <https://www.rfc-editor.org/info/rfc4086>.

   [RFC7252]  Shelby, Z., Hartke, K., and
   resource constrained environments.  The interested reader is
   encouraged to first read [I-D.ietf-core-groupcomm-bis] to understand
   the non-security related details.  This section discusses a number C. Bormann, "The Constrained
              Application Protocol (CoAP)", RFC 7252,
              DOI 10.17487/RFC7252, June 2014,
              <https://www.rfc-editor.org/info/rfc7252>.

   [RFC7748]  Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves
              for Security", RFC 7748, DOI 10.17487/RFC7748, January
              2016, <https://www.rfc-editor.org/info/rfc7748>.

   [RFC8032]  Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital
              Signature Algorithm (EdDSA)", RFC 8032,
              DOI 10.17487/RFC8032, January 2017,
              <https://www.rfc-editor.org/info/rfc8032>.

   [RFC8174]  Leiba, B., "Ambiguity of
   use cases that benefit from secure group communication, Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8610]  Birkholz, H., Vigano, C., and refers C. Bormann, "Concise Data
              Definition Language (CDDL): A Notational Convention to
   the three types of groups from Appendix A.  Specific security
   requirements
              Express Concise Binary Object Representation (CBOR) and
              JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610,
              June 2019, <https://www.rfc-editor.org/info/rfc8610>.

   [RFC8613]  Selander, G., Mattsson, J., Palombini, F., and L. Seitz,
              "Object Security for these use cases are discussed in Appendix A.

   o  Lighting control: consider a building equipped with IP-connected
      lighting devices, switches, Constrained RESTful Environments
              (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019,
              <https://www.rfc-editor.org/info/rfc8613>.

   [RFC8949]  Bormann, C. and border routers.  The lighting
      devices acting as servers are organized into application groups P. Hoffman, "Concise Binary Object
              Representation (CBOR)", STD 94, RFC 8949,
              DOI 10.17487/RFC8949, December 2020,
              <https://www.rfc-editor.org/info/rfc8949>.

12.2.  Informative References

   [Degabriele]
              Degabriele, J.P., Lehmann, A., Paterson, K.G., Smart,
              N.P., and CoAP groups, according to their physical location in M. Strefler, "On the
      building.  For instance, lighting devices in a room or corridor
      can be configured as members Joint Security of a single application group
              Encryption and
      corresponding CoAP group.  Those lighting devices together with
      the switches acting as clients in the same room or corridor can be
      configured as members of the corresponding security group.
      Switches are then used to control the lighting devices by sending
      on/off/dimming commands to all lighting devices Signature in the CoAP group,
      while border routers connected to an IP network backbone (which is
      also multicast-enabled) can be used to interconnect routers EMV", December 2011,
              <https://eprint.iacr.org/2011/615>.

   [I-D.amsuess-core-cachable-oscore]
              Amsüss, C. and M. Tiloca, "Cacheable OSCORE", Work in
              Progress, Internet-Draft, draft-amsuess-core-cachable-
              oscore-01, 22 February 2021,
              <https://www.ietf.org/archive/id/draft-amsuess-core-
              cachable-oscore-01.txt>.

   [I-D.ietf-ace-key-groupcomm]
              Palombini, F. and M. Tiloca, "Key Provisioning for Group
              Communication using ACE", Work in the
      building.  Consequently, this would also enable logical groups to
      be formed even if devices with a role Progress, Internet-
              Draft, draft-ietf-ace-key-groupcomm-13, 12 July 2021,
              <https://www.ietf.org/archive/id/draft-ietf-ace-key-
              groupcomm-13.txt>.

   [I-D.ietf-ace-key-groupcomm-oscore]
              Tiloca, M., Park, J., and F. Palombini, "Key Management
              for OSCORE Groups in the lighting application
      may be physically ACE", Work in different subnets (e.g. on wired Progress, Internet-
              Draft, draft-ietf-ace-key-groupcomm-oscore-11, 12 July
              2021, <https://www.ietf.org/archive/id/draft-ietf-ace-key-
              groupcomm-oscore-11.txt>.

   [I-D.ietf-ace-oauth-authz]
              Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and wireless
      networks).  Connectivity between lighting devices may be realized,
      for instance, by means of IPv6
              H. Tschofenig, "Authentication and (border) routers supporting
      6LoWPAN [RFC4944][RFC6282].  Group communication enables
      synchronous operation of a set of connected lights, ensuring that
      the light preset (e.g. dimming level or color) of a large set of
      luminaires are changed at the same perceived time.  This is
      especially useful Authorization for providing a visual synchronicity of light
      effects to
              Constrained Environments (ACE) using the user.  As a practical guideline, events within a
      200 ms interval are perceived OAuth 2.0
              Framework (ACE-OAuth)", Work in Progress, Internet-Draft,
              draft-ietf-ace-oauth-authz-43, 10 July 2021,
              <https://www.ietf.org/archive/id/draft-ietf-ace-oauth-
              authz-43.txt>.

   [I-D.ietf-core-echo-request-tag]
              Amsüss, C., Mattsson, J. P., and G. Selander, "CoAP: Echo,
              Request-Tag, and Token Processing", Work in Progress,
              Internet-Draft, draft-ietf-core-echo-request-tag-12, 1
              February 2021, <https://www.ietf.org/archive/id/draft-
              ietf-core-echo-request-tag-12.txt>.

   [I-D.ietf-core-observe-multicast-notifications]
              Tiloca, M., Hoeglund, R., Amsuess, C., and F. Palombini,
              "Observe Notifications as simultaneous by humans, which is
      necessary to ensure CoAP Multicast Responses", Work
              in many setups.  Devices may reply back to the
      switches that issue on/off/dimming commands, Progress, Internet-Draft, draft-ietf-core-observe-
              multicast-notifications-01, 12 July 2021,
              <https://www.ietf.org/archive/id/draft-ietf-core-observe-
              multicast-notifications-01.txt>.

   [I-D.ietf-cose-cbor-encoded-cert]
              Raza, S., Höglund, J., Selander, G., Mattsson, J. P., and
              M. Furuhed, "CBOR Encoded X.509 Certificates (C509
              Certificates)", Work in order to report
      about the execution of the requested operation (e.g.  OK, failure,
      error) Progress, Internet-Draft, draft-
              ietf-cose-cbor-encoded-cert-01, 25 May 2021,
              <https://www.ietf.org/archive/id/draft-ietf-cose-cbor-
              encoded-cert-01.txt>.

   [I-D.ietf-lwig-curve-representations]
              Struik, R., "Alternative Elliptic Curve Representations",
              Work in Progress, Internet-Draft, draft-ietf-lwig-curve-
              representations-21, 9 June 2021,
              <https://www.ietf.org/archive/id/draft-ietf-lwig-curve-
              representations-21.txt>.

   [I-D.ietf-lwig-security-protocol-comparison]
              Mattsson, J. P., Palombini, F., and their current operational status.  In a typical
      lighting control scenario, a single switch is the only entity
      responsible for sending commands to a set M. Vucinic,
              "Comparison of lighting devices.  In
      more advanced lighting control use cases, a M-to-N communication
      topology would be required, CoAP Security Protocols", Work in Progress,
              Internet-Draft, draft-ietf-lwig-security-protocol-
              comparison-05, 2 November 2020,
              <https://www.ietf.org/archive/id/draft-ietf-lwig-security-
              protocol-comparison-05.txt>.

   [I-D.ietf-rats-uccs]
              Birkholz, H., O'Donoghue, J., Cam-Winget, N., and C.
              Bormann, "A CBOR Tag for instance Unprotected CWT Claims Sets",
              Work in Progress, Internet-Draft, draft-ietf-rats-uccs-00,
              19 May 2021, <https://www.ietf.org/archive/id/draft-ietf-
              rats-uccs-00.txt>.

   [I-D.ietf-tls-dtls13]
              Rescorla, E., Tschofenig, H., and N. Modadugu, "The
              Datagram Transport Layer Security (DTLS) Protocol Version
              1.3", Work in case multiple sensors
      (presence or day-light) are responsible to trigger events to a set
      of lighting devices.  Especially Progress, Internet-Draft, draft-ietf-tls-
              dtls13-43, 30 April 2021, <https://www.ietf.org/internet-
              drafts/draft-ietf-tls-dtls13-43.txt>.

   [I-D.mattsson-cfrg-det-sigs-with-noise]
              Mattsson, J. P., Thormarker, E., and S. Ruohomaa,
              "Deterministic ECDSA and EdDSA Signatures with Additional
              Randomness", Work in professional lighting
      scenarios, the roles of client Progress, Internet-Draft, draft-
              mattsson-cfrg-det-sigs-with-noise-02, 11 March 2020,
              <https://www.ietf.org/archive/id/draft-mattsson-cfrg-det-
              sigs-with-noise-02.txt>.

   [RFC4944]  Montenegro, G., Kushalnagar, N., Hui, J., and server are configured by the
      lighting commissioner, D. Culler,
              "Transmission of IPv6 Packets over IEEE 802.15.4
              Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007,
              <https://www.rfc-editor.org/info/rfc4944>.

   [RFC4949]  Shirey, R., "Internet Security Glossary, Version 2",
              FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007,
              <https://www.rfc-editor.org/info/rfc4949>.

   [RFC5869]  Krawczyk, H. and devices strictly follow those roles.

   o  Integrated building control: enabling Building Automation P. Eronen, "HMAC-based Extract-and-Expand
              Key Derivation Function (HKDF)", RFC 5869,
              DOI 10.17487/RFC5869, May 2010,
              <https://www.rfc-editor.org/info/rfc5869>.

   [RFC6282]  Hui, J., Ed. and
      Control Systems (BACSs) to control multiple heating, ventilation P. Thubert, "Compression Format for IPv6
              Datagrams over IEEE 802.15.4-Based Networks", RFC 6282,
              DOI 10.17487/RFC6282, September 2011,
              <https://www.rfc-editor.org/info/rfc6282>.

   [RFC6347]  Rescorla, E. and air-conditioning units to predefined presets.  Controlled
      units can be organized into application groups N. Modadugu, "Datagram Transport Layer
              Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
              January 2012, <https://www.rfc-editor.org/info/rfc6347>.

   [RFC7228]  Bormann, C., Ersue, M., and CoAP groups in
      order to reflect their physical position A. Keranen, "Terminology for
              Constrained-Node Networks", RFC 7228,
              DOI 10.17487/RFC7228, May 2014,
              <https://www.rfc-editor.org/info/rfc7228>.

   [RFC7641]  Hartke, K., "Observing Resources in the building, e.g.
      devices in Constrained
              Application Protocol (CoAP)", RFC 7641,
              DOI 10.17487/RFC7641, September 2015,
              <https://www.rfc-editor.org/info/rfc7641>.

   [RFC7925]  Tschofenig, H., Ed. and T. Fossati, "Transport Layer
              Security (TLS) / Datagram Transport Layer Security (DTLS)
              Profiles for the same room can be configured as members Internet of a single
      application group Things", RFC 7925,
              DOI 10.17487/RFC7925, July 2016,
              <https://www.rfc-editor.org/info/rfc7925>.

   [RFC7959]  Bormann, C. and corresponding CoAP group.  As a practical
      guideline, events within intervals of seconds are typically
      acceptable.  Controlled units are expected to possibly reply back
      to the BACS issuing control commands, Z. Shelby, Ed., "Block-Wise Transfers in order to report about the
      execution of
              the requested operation (e.g.  OK, failure, error)
      and their current operational status.

   o  Software and firmware updates: software Constrained Application Protocol (CoAP)", RFC 7959,
              DOI 10.17487/RFC7959, August 2016,
              <https://www.rfc-editor.org/info/rfc7959>.

   [RFC8392]  Jones, M., Wahlstroem, E., Erdtman, S., and firmware updates often
      comprise quite a large amount of data.  This can overload a Low-
      power H. Tschofenig,
              "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392,
              May 2018, <https://www.rfc-editor.org/info/rfc8392>.

   [Thormarker]
              Thormarker, E., "On using the same key pair for Ed25519
              and Lossy Network (LLN) that is otherwise typically used to
      deal with only small amounts of data, on an infrequent base.
      Rather than sending software X25519 based KEM", April 2021,
              <https://eprint.iacr.org/2021/509>.

Appendix A.  Assumptions and firmware updates as unicast
      messages to each individual device, multicasting such updated data
      to Security Objectives

   This section presents a larger set of devices at once displays a number of benefits.
      For instance, it can significantly reduce the network load assumptions and
      decrease the overall time latency security objectives
   for propagating this data to all
      devices.  Even if the complete whole update process itself is
      secured, securing the individual messages is important, approach described in case
      updates consist this document.  The rest of relatively large amounts this
   section refers to three types of data.  In fact,
      checking individual received data piecemeal for tampering avoids
      that devices store large amounts groups:

   *  Application group, i.e., a set of partially corrupted data and CoAP endpoints that they detect tampering hereof only after all data has been
      received.  Devices receiving software and firmware updates are
      expected to possibly reply back, in order to provide share a feedback
      about the execution
      common pool of the update operation (e.g.  OK, failure,
      error) and their current operational status.

   o  Parameter resources.

   *  Security group, as defined in Section 1.1 of this document.  There
      can be a one-to-one or a one-to-many relation between security
      groups and configuration update: by means application groups, and vice versa.

   *  CoAP group, i.e., a set of multicast
      communication, it CoAP endpoints where each endpoint is possible
      configured to receive one-to-many CoAP requests, e.g., sent to update the settings of
      group's associated IP multicast address and UDP port as defined in
      [I-D.ietf-core-groupcomm-bis].  An endpoint may be a set member of
      similar devices, both simultaneously and efficiently.  Possible
      parameters are related, for instance, to network load management
      multiple CoAP groups.  There can be a one-to-one or network access controls.  Devices receiving parameter a one-to-many
      relation between application groups and
      configuration updates are expected to possibly reply back, CoAP groups.  Note that a
      device sending a CoAP request to
      provide a feedback about the execution CoAP group is not necessarily
      itself a member of that group: it is a member only if it also has
      a CoAP server endpoint listening to requests for this CoAP group,
      sent to the update operation
      (e.g.  OK, failure, error) associated IP multicast address and their current operational status.

   o  Commissioning port.  In order to
      provide secure group communication, all members of Low-power and Lossy Network (LLN) systems: a
      commissioning device is responsible for querying CoAP group as
      well as all devices in further endpoints configured only as clients sending
      CoAP (multicast) requests to the local network or a selected subset of them, in order CoAP group have to
      discover their presence, and be aware member of their capabilities,
      default configuration, and operating conditions.  Queried devices
      displaying similarities in their capabilities and features, or
      sharing a common physical location
      security group.  There can be configured as members of a single application group and corresponding CoAP group.  Queried
      devices one-to-one or a one-to-many
      relation between security groups and CoAP groups, and vice versa.

A.1.  Assumptions

   The following points are expected to reply back to the commissioning device, in
      order assumed to notify their presence, be already addressed and provide are out
   of the requested
      information scope of this document.

   *  Multicast communication topology: this document considers both
      1-to-N (one sender and their current operational status.

   o  Emergency multicast: a particular emergency related information
      (e.g. natural disaster) is generated multiple recipients) and multicast by an emergency
      notifier, M-to-N (multiple
      senders and relayed to multiple devices. recipients) communication topologies.  The latter may reply
      back to
      1-to-N communication topology is the emergency notifier, in order to provide their feedback
      and local information related to simplest group communication
      scenario that would serve the ongoing emergency.  This kind needs of setups should additionally rely on a fault tolerance multicast
      algorithm, such as Multicast Protocol for Low-Power typical Low-power and
      Lossy
      Networks (MPL).

Appendix C.  Example of Group Identifier Format

   This section provides an example of how the Group Identifier (Gid)
   can be specifically formatted.  That is, the Gid can be composed Network (LLN).  Examples of
   two parts, namely use cases that benefit from
      secure group communication are provided in Appendix B.

      In a Group Prefix and 1-to-N communication model, only a Group Epoch.

   For each group, single client transmits
      data to the Group Prefix is constant over time and is
   uniquely defined CoAP group, in the set form of all request messages; in an
      M-to-N communication model (where M and N do not necessarily have
      the groups same value), M clients transmit data to the CoAP group.
      According to [I-D.ietf-core-groupcomm-bis], any possible proxy
      entity is supposed to know about the clients.  Also, every client
      expects and is able to handle multiple response messages
      associated to the a same
   Group Manager.  The choice of request sent to the CoAP group.

   *  Group Prefix size: security solutions for a given group's
   Security Context is application specific. group communication should be
      able to adequately support different and possibly large security
      groups.  The group size is the current number of members in a
      security group.  In the Group
   Prefix directly impact on use cases mentioned in this document, the maximum
      number of distinct groups under clients (normally the same Group Manager.

   The Group Epoch controlling devices) is set expected
      to 0 upon be much smaller than the group's initialization, and is
   incremented by 1 each time new keying material, together with a new
   Gid, is distributed to number of servers (i.e., the
      controlled devices).  A security solution for group in order communication
      that supports 1 to establish a new Security
   Context (see Section 3.1).

   As an example, a 3-byte Gid can 50 clients would be composed of: i) a 1-byte Group
   Prefix '0xb1' interpreted as a raw byte string; and ii) a 2-byte
   Group Epoch interpreted as an unsigned integer ranging from 0 able to
   65535.  Then, after having established the Common Context 61532 times
   in properly cover the group, its Gid will assume value '0xb1f05c'.

   Using an immutable Group Prefix for a
      group assumes sizes required for most use cases that enough time
   elapses before all possible Group Epoch values are used, since the
   Group Manager never reassigns the same Gid to the same group.  Thus,
   the expected highest rate relevant for addition/removal of group members and
   consequent this
      document.  The maximum group rekeying size is expected to be in the range
      of 2 to 100 devices.  Security groups larger than that should be taken
      divided into account for a proper
   dimensioning smaller independent groups.  One should not assume
      that the set of members of a security group remains fixed.  That
      is, the Group Epoch size.

   As discussed in Section 10.5, if endpoints are deployed in multiple
   groups managed by different non-synchronized Group Managers, it group membership is
   possible that subject to changes, possibly on a
      frequent basis.

   *  Communication with the Group Identifiers of different groups coincide at some
   point in time.  In this case, Manager: an endpoint must use a recipient has to handle coinciding
      secure dedicated channel when communicating with the Group Identifiers,
      Manager, also when not registered as a member of the security
      group.

   *  Provisioning and has to try using different management of Security Contexts Contexts: a Security
      Context must be established among the members of the security
      group.  A secure mechanism must be used to process an incoming message, until generate, revoke and
      (re-)distribute keying material, communication policies and
      security parameters in the right one is found security group.  The actual
      provisioning and management of the
   message is correctly verified.  Therefore, it Security Context is favorable that Group
   Identifiers from different Group Managers have a size that result in
   a small probability out of the
      scope of collision.  How small this probability should
   be is up to system designers.

Appendix D.  Set-up document.

   *  Multicast data security ciphersuite: all members of New Endpoints

   An endpoint joins a security
      group by explicitly interacting with the
   responsible Group Manager.  When becoming members of must agree on a group,
   endpoints are not required ciphersuite to know how many provide authenticity,
      integrity and what endpoints are confidentiality of messages in the same group.

   Communications between  The
      ciphersuite is specified as part of the Security Context.

   *  Backward security: a new device joining endpoint and the Group Manager rely
   on the CoAP protocol and must be secured.  Specific details on how security group should
      not have access to
   secure communications between joining endpoints and any old Security Contexts used before its
      joining.  This ensures that a Group Manager
   are out new member of the scope of this document. security group is
      not able to decrypt confidential data sent before it has joined
      the security group.  The Group Manager must verify adopted key management scheme should
      ensure that the joining endpoint Security Context is authorized updated to join ensure backward
      confidentiality.  The actual mechanism to update the group.  To this end, Security
      Context and renew the Group Manager can directly
   authorize group keying material in the joining endpoint, or expect it to provide authorization
   evidence previously obtained from security group
      upon a trusted entity.  Further details
   about the authorization of new member's joining endpoints are out of scope.

   In case has to be defined as part of successful authorization check, the Group Manager
   generates a Sender ID assigned to group
      key management scheme.

   *  Forward security: entities that leave the joining endpoint, before
   proceeding with security group should
      not have access to any future Security Contexts or message
      exchanged within the rest security group after their leaving.  This
      ensures that a former member of the join process.  That is, the Group
   Manager provides security group is not able to
      decrypt confidential data sent within the joining endpoint with security group anymore.
      Also, it ensures that a former member is not able to send
      protected messages to the keying material and
   parameters security group anymore.  The actual
      mechanism to initialize update the Security Context (see Section 2).  The
   actual provisioning of keying material and parameters to renew the joining
   endpoint is out of group
      keying material in the scope security group upon a member's leaving has
      to be defined as part of this document.

   It is RECOMMENDED that the join process adopts the group key management scheme.

A.2.  Security Objectives

   The approach described in [I-D.ietf-ace-key-groupcomm-oscore] and based on this document aims at fulfilling the ACE framework
   for Authentication and Authorization
   following security objectives:

   *  Data replay protection: group request messages or response
      messages replayed within the security group must be detected.

   *  Data confidentiality: messages sent within the security group
      shall be encrypted.

   *  Group-level data confidentiality: the group mode provides group-
      level data confidentiality since messages are encrypted at a group
      level, i.e., in constrained environments
   [I-D.ietf-ace-oauth-authz].

Appendix E.  Challenge-Response Synchronization

   This section describes such a possible approach way that a server endpoint they can
   use to synchronize with Sender Sequence Numbers be decrypted by any
      member of client endpoints
   in the group.  In particular, the server performs a challenge-
   response exchange with a client, security group, but not by an external adversary or
      other external entities.

   *  Pairwise data confidentiality: the pairwise mode especially
      provides pairwise data confidentiality, since messages are
      encrypted using pairwise keying material shared between any two
      group members, hence they can be decrypted only by the Echo Option for CoAP
   described in Section 2 of [I-D.ietf-core-echo-request-tag] and
   according to Appendix B.1.2 of [RFC8613]. intended
      single recipient.

   *  Source message authentication: messages sent within the security
      group shall be authenticated.  That is, upon receiving it is essential to ensure
      that a request from message is originated by a particular client for the
   first time, the server processes member of the message as described security group in this
   specification, but, even if valid, does not deliver it to the
   application.  Instead,
      the server replies to first place, and in particular by a specific, identifiable
      member of the client with an
   OSCORE protected 4.01 (Unauthorized) response message, including only security group.

   *  Message integrity: messages sent within the Echo Option and no diagnostic payload.  The Echo option value
   SHOULD NOT security group shall
      be reused; when integrity protected.  That is, it is reused, essential to ensure that a
      message has not been tampered with, either by a group member, or
      by an external adversary or other external entities which are not
      members of the security group.

   *  Message ordering: it MUST must be highly unlikely possible to have been used determine the ordering of
      messages coming from a single sender.  In accordance with OSCORE
      [RFC8613], this client recently.  Since this response is
   protected with the Security Context used results in the group, the client
   will consider the response valid upon successfully decrypting providing absolute freshness of
      responses that are not notifications, as well as relative
      freshness of group requests and
   verifying it.

   The server stores notification responses.  It is not
      required to determine ordering of messages from different senders.

Appendix B.  List of Use Cases

   Group Communication for CoAP [I-D.ietf-core-groupcomm-bis] provides
   the Echo Option value included therein, together necessary background for multicast-based CoAP communication, with the pair (gid,kid), where 'gid'
   particular reference to low-power and lossy networks (LLNs) and
   resource constrained environments.  The interested reader is
   encouraged to first read [I-D.ietf-core-groupcomm-bis] to understand
   the Group Identifier non-security related details.  This section discusses a number of the
   OSCORE
   use cases that benefit from secure group communication, and 'kid' is refers to
   the Sender ID three types of the client in the group,
   as specified groups from Appendix A.  Specific security
   requirements for these use cases are discussed in the 'kid context' and 'kid' fields of the OSCORE
   Option of the request, respectively.  After Appendix A.

   *  Lighting control: consider a group rekeying has been
   completed building equipped with IP-connected
      lighting devices, switches, and a new Security Context has been established border routers.  The lighting
      devices acting as servers are organized into application groups
      and CoAP groups, according to their physical location in the
   group, which results also
      building.  For instance, lighting devices in a new Group Identifier (see
   Section 3.1), the server MUST delete all the stored Echo values
   associated to room or corridor
      can be configured as members of that group.

   Upon receiving a 4.01 (Unauthorized) response that includes an Echo
   Option and originates from a verified single application group member, and
      corresponding CoAP group.  Those lighting devices together with
      the client sends
   a request switches acting as a unicast message addressed to the same server, echoing
   the Echo Option value.  The client MUST NOT send the request
   including the Echo Option over multicast.

   If the signature algorithm used clients in the group supports ECDH (e.g.
   ECDSA, EdDSA), the client MUST use the pairwise mode of Group OSCORE
   to protect the request, as described in Section 9.3.  Note that, same room or corridor can be
      configured as
   defined in Section 9, members of such a group and that use the Echo
   Option MUST support corresponding security group.
      Switches are then used to control the pairwise mode.

   The client does not necessarily resend lighting devices by sending
      on/off/dimming commands to all lighting devices in the same group request, but CoAP group,
      while border routers connected to an IP network backbone (which is
      also multicast-enabled) can instead send a more recent one, if the application permits it.
   This makes it possible for be used to interconnect routers in the client
      building.  Consequently, this would also enable logical groups to not retain previously sent
   group requests for full retransmission, unless
      be formed even if devices with a role in the lighting application
   explicitly requires otherwise.  In either case,
      may be physically in different subnets (e.g., on wired and
      wireless networks).  Connectivity between lighting devices may be
      realized, for instance, by means of IPv6 and (border) routers
      supporting 6LoWPAN [RFC4944][RFC6282].  Group communication
      enables synchronous operation of a set of connected lights,
      ensuring that the client uses light preset (e.g., dimming level or color) of a
   fresh Sender Sequence Number value from its own Sender Context.  If
      large set of luminaires are changed at the client stores group requests same perceived time.
      This is especially useful for possible retransmission with providing a visual synchronicity of
      light effects to the
   Echo Option, it should not store user.  As a given request for longer than practical guideline, events
      within a
   preconfigured time interval.  Note 200 ms interval are perceived as simultaneous by humans,
      which is necessary to ensure in many setups.  Devices may reply
      back to the switches that issue on/off/dimming commands, in order
      to report about the unicast request echoing execution of the Echo Option is correctly treated requested operation (e.g.,
      OK, failure, error) and processed as their current operational status.  In a message,
   since the 'kid context' field including
      typical lighting control scenario, a single switch is the Group Identifier only
      entity responsible for sending commands to a set of the
   OSCORE group is still present lighting
      devices.  In more advanced lighting control use cases, a M-to-N
      communication topology would be required, for instance in the OSCORE Option as part case
      multiple sensors (presence or day-light) are responsible to
      trigger events to a set of lighting devices.  Especially in
      professional lighting scenarios, the
   COSE object (see Section 4).

   Upon receiving the unicast request including the Echo Option, the
   server performs the following verifications.

   o  If the roles of client and server does not store an Echo Option value for the pair
      (gid,kid), it considers: i) the time t1 when it has established
      are configured by the Security Context used lighting commissioner, and devices strictly
      follow those roles.

   *  Integrated building control: enabling Building Automation and
      Control Systems (BACSs) to protect the received request; control multiple heating, ventilation
      and ii) air-conditioning units to predefined presets.  Controlled
      units can be organized into application groups and CoAP groups in
      order to reflect their physical position in the time t2 when building, e.g.,
      devices in the request has been received.  Since a valid
      request cannot same room can be older than configured as members of a single
      application group and corresponding CoAP group.  As a practical
      guideline, events within intervals of seconds are typically
      acceptable.  Controlled units are expected to possibly reply back
      to the Security Context used BACS issuing control commands, in order to protect
      it, report about the server verifies that (t2 - t1) is less than
      execution of the largest requested operation (e.g., OK, failure, error)
      and their current operational status.

   *  Software and firmware updates: software and firmware updates often
      comprise quite a large amount of time acceptable data.  This can overload a Low-
      power and Lossy Network (LLN) that is otherwise typically used to consider the request fresh.

   o  If the server stores
      deal with only small amounts of data, on an Echo Option value for the pair (gid,kid)
      associated infrequent base.
      Rather than sending software and firmware updates as unicast
      messages to that same client in the same group, each individual device, multicasting such updated data
      to a larger set of devices at once displays a number of benefits.
      For instance, it can significantly reduce the server
      verifies that network load and
      decrease the option value equals that same stored value
      previously sent overall time latency for propagating this data to that client.

   If the verifications above fail, all
      devices.  Even if the server MUST NOT complete whole update process itself is
      secured, securing the
   request further and MAY send a 4.01 (Unauthorized) response including
   an Echo Option.

   If the verifications above are successful individual messages is important, in case
      updates consist of relatively large amounts of data.  In fact,
      checking individual received data piecemeal for tampering avoids
      that devices store large amounts of partially corrupted data and the Replay Window
      that they detect tampering hereof only after all data has
   not been set yet, the server
      received.  Devices receiving software and firmware updates its Replay Window are
      expected to mark possibly reply back, in order to provide a feedback
      about the
   current Sender Sequence Number from execution of the latest received request as
   seen (but all newer ones as new), update operation (e.g., OK, failure,
      error) and delivers their current operational status.

   *  Parameter and configuration update: by means of multicast
      communication, it is possible to update the message as fresh settings of a set of
      similar devices, both simultaneously and efficiently.  Possible
      parameters are related, for instance, to network load management
      or network access controls.  Devices receiving parameter and
      configuration updates are expected to possibly reply back, to
      provide a feedback about the application.  Otherwise, it discards execution of the verification result update operation
      (e.g., OK, failure, error) and treats their current operational status.

   *  Commissioning of Low-power and Lossy Network (LLN) systems: a
      commissioning device is responsible for querying all devices in
      the message as fresh local network or as a replay, according selected subset of them, in order to the
   existing Replay Window.

   A server should not deliver requests from
      discover their presence, and be aware of their capabilities,
      default configuration, and operating conditions.  Queried devices
      displaying similarities in their capabilities and features, or
      sharing a given client to the
   application until one valid request from that same client has been
   verified as fresh, common physical location can be configured as conveying an echoed Echo Option
   [I-D.ietf-core-echo-request-tag].  Also, a server may perform the
   challenge-response described above at any time, if synchronization
   with Sender Sequence Numbers members of clients is lost, for instance after
      a
   device reboot.  A client has single application group and corresponding CoAP group.  Queried
      devices are expected to be always ready reply back to perform the
   challenge-response based on the Echo Option commissioning device, in case
      order to notify their presence, and provide the requested
      information and their current operational status.

   *  Emergency multicast: a server starts
   it.

   It particular emergency related information
      (e.g., natural disaster) is generated and multicast by an
      emergency notifier, and relayed to multiple devices.  The latter
      may reply back to the role of the server application emergency notifier, in order to provide
      their feedback and local information related to define under what
   circumstances Sender Sequence Numbers lose synchronization.  This can
   include experiencing a "large enough" gap D = (SN2 - SN1), between the Sender Sequence Number SN1 ongoing
      emergency.  This kind of the latest accepted group request
   from setups should additionally rely on a client
      fault tolerance multicast algorithm, such as Multicast Protocol
      for Low-Power and Lossy Networks (MPL).

Appendix C.  Example of Group Identifier Format

   This section provides an example of how the Sender Sequence Number SN2 Group Identifier (Gid)
   can be specifically formatted.  That is, the Gid can be composed of
   two parts, namely a group request
   just received from that client.  However, Group Prefix and a client may send several
   unicast requests to different group members as protected with Group Epoch.

   For each group, the
   pairwise mode (see Section 9.3), which may result Group Prefix is constant over time and is
   uniquely defined in the server
   experiencing the gap D in a relatively short time.  This would induce set of all the server groups associated to perform more challenge-response exchanges than actually
   needed.

   To ameliorate this, the server may rather rely on a trade-off between same
   Group Manager.  The choice of the Sender Sequence Number gap D and Group Prefix for a time gap T = (t2 - t1), where
   t1 given group's
   Security Context is application specific.  The size of the time when Group
   Prefix directly impact on the latest group request from a client was
   accepted and t2 maximum number of distinct groups under
   the same Group Manager.

   The Group Epoch is set to 0 upon the group's initialization, and is
   incremented by 1 each time when new keying material, together with a new
   Gid, is distributed to the latest group request from that
   client has been received, respectively.  Then, the server can start a
   challenge-response when experiencing in order to establish a time gap T larger than new Security
   Context (see Section 3.2).

   As an example, a
   given, preconfigured threshold.  Also, the server 3-byte Gid can start be composed of: i) a
   challenge-response when experiencing 1-byte Group
   Prefix '0xb1' interpreted as a Sender Sequence Number gap D
   greater than raw byte string; and ii) a different threshold, computed 2-byte
   Group Epoch interpreted as a monotonically
   increasing function of the currently experienced time gap T.

   The challenge-response approach described in this appendix provides
   an assurance of absolute message freshness.  However, it can result
   in an impact on performance which is undesirable or unbearable,
   especially in large groups where many endpoints at unsigned integer ranging from 0 to
   65535.  Then, after having established the same time
   might join as new members or lose synchronization.

   Note Common Context 61532 times
   in the group, its Gid will assume value '0xb1f05c'.

   Using an immutable Group Prefix for a group assumes that endpoints configured as silent servers enough time
   elapses before all possible Group Epoch values are not able to
   perform used, i.e., before
   the challenge-response described above, as they do not store
   a Sender Context Group Manager starts reassigning Gid values to secure the 4.01 (Unauthorized) response to same group
   (see Section 3.2).  Thus, the
   client.  Therefore, silent servers should adopt alternative
   approaches to achieve and maintain synchronization with sender
   sequence numbers expected highest rate for addition/
   removal of clients.

   Since requests including the Echo Option are sent over unicast, a
   server can group members and consequent group rekeying should be
   taken into account for a victim proper dimensioning of the attack Group Epoch size.

   As discussed in Section 10.7, when
   such requests 10.6, if endpoints are protected with the group mode of Group OSCORE, as
   described deployed in Section 8.1.

   Instead, protecting requests with the Echo Option multiple
   groups managed by using the
   pairwise mode of different non-synchronized Group OSCORE as described in Section 9.3 prevents
   the attack Managers, it is
   possible that Group Identifiers of different groups coincide at some
   point in Section 10.7. time.  In fact, only the exact server involved
   in the Echo exchange is able this case, a recipient has to derive the correct pairwise key used
   by the client handle coinciding
   Group Identifiers, and has to protect try using different Security Contexts
   to process an incoming message, until the request including right one is found and the Echo Option.

   In either case, an internal on-path adversary would not
   message is correctly verified.  Therefore, it is favorable that Group
   Identifiers from different Group Managers have a size that result in
   a small probability of collision.  How small this probability should
   be able to
   mix is up the Echo Option value to system designers.

Appendix D.  Set-up of two different unicast requests, sent New Endpoints

   An endpoint joins a group by explicitly interacting with the
   responsible Group Manager.  When becoming members of a same client group,
   endpoints are not required to any two different servers know how many and what endpoints are in
   the same group.  In fact,
   if

   Communications between a joining endpoint and the group mode was used, this would require Group Manager rely
   on the adversary CoAP protocol and must be secured.  Specific details on how to forge
   the client's countersignature in both such requests.  As
   secure communications between joining endpoints and a
   consequence, each Group Manager
   are out of the two servers remains able to selectively
   accept a request with the Echo Option only if it is waiting for that
   exact integrity-protected Echo Option value, and is thus the intended
   recipient.

Appendix F.  No Verification scope of Signatures in this document.

   The Group Mode

   There are some application scenarios using group communication Manager must verify that
   have particularly strict requirements.  One example of this the joining endpoint is authorized
   to join the
   requirement of low message latency in non-emergency lighting
   applications [I-D.somaraju-ace-multicast].  For those applications
   which have tight performance constraints and relaxed security
   requirements, it group.  To this end, the Group Manager can be inconvenient for some endpoints to verify
   digital signatures in order directly
   authorize the joining endpoint, or expect it to assert source authenticity of received
   messages protected with provide authorization
   evidence previously obtained from a trusted entity.  Further details
   about the group mode. authorization of joining endpoints are out of scope.

   In other cases, case of successful authorization check, the
   signature verification can be deferred or only checked for specific
   actions.  For instance, Group Manager
   generates a command Sender ID assigned to turn a bulb on where the bulb is
   already on does not need the signature to be checked.  In such
   situations, joining endpoint, before
   proceeding with the counter signature needs to be included anyway as part rest of a message protected with the group mode, so that an endpoint that
   needs to validate join process.  That is, the signature for any reason has Group
   Manager provides the ability joining endpoint with the keying material and
   parameters to do
   so.

   In this specification, it is NOT RECOMMENDED that endpoints do not
   verify initialize the counter signature Security Context, including its own
   public key (see Section 2).  The actual provisioning of received messages protected with keying
   material and parameters to the
   group mode.  However, it is recognized that there may be situations
   where it joining endpoint is not always required.  The consequence out of not doing the
   signature validation in messages protected with the group mode scope
   of this document.

   It is RECOMMENDED that security in the group is join process adopts the approach described
   in [I-D.ietf-ace-key-groupcomm-oscore] and based only on the group-authenticity ACE framework
   for Authentication and Authorization in constrained environments
   [I-D.ietf-ace-oauth-authz].

Appendix E.  Challenge-Response Synchronization

   This section describes a possible approach that a server endpoint can
   use to synchronize with Sender Sequence Numbers of client endpoints
   in the shared keying material used group.  In particular, the server performs a challenge-
   response exchange with a client, by using the Echo Option for encryption. CoAP
   described in Section 2 of [I-D.ietf-core-echo-request-tag] and
   according to Appendix B.1.2 of [RFC8613].

   That is, endpoints
   in upon receiving a request from a particular client for the group would have evidence that
   first time, the server processes the received message has been
   originated by a group member, although not specifically identifiable
   in a secure way.  This can violate a number of security requirements, as the compromise of any element described in this
   document, but, even if valid, does not deliver it to the group means that the attacker
   has application.
   Instead, the ability server replies to control the entire group.  Even worse, client with an OSCORE protected
   4.01 (Unauthorized) response message, including only the group
   may not be limited in scope, Echo Option
   and hence the same keying material might no diagnostic payload.  The Echo option value SHOULD NOT be used not only for light bulbs but for locks as well.  Therefore,
   extreme care must
   reused; when it is reused, it MUST be taken highly unlikely to have been
   used with this client recently.  Since this response is protected
   with the Security Context used in situations where the security
   requirements are relaxed, so that deployment of group, the system client will
   always be done safely.

Appendix G.  Example Values with COSE Capabilities consider
   the response valid upon successfully decrypting and verifying it.

   The table below provides examples of values for Counter Signature
   Parameters in server stores the Common Context (see Section 2.1.3), for different
   values of Counter Signature Algorithm.

    +-------------------+---------------------------------------------+
    | Counter Signature | Example Values for Counter                  |
    | Algorithm         | Signature Parameters                        |
    +-------------------+---------------------------------------------+
    |  (-8)   // EdDSA  | [1], [1, 6]  // 1: OKP ; 1: OKP, 6: Ed25519 |
    |  (-8)   // EdDSA  | [1], [1, 7]  // 1: OKP ; 1: OKP, 7: Ed448   |
    |  (-7)   // ES256  | [2], [2, 1]  // 2: EC2 ; 2: EC2, 1: P-256   |
    |  (-35)  // ES384  | [2], [2, 2]  // 2: EC2 ; 2: EC2, 2: P-384   |
    |  (-36)  // ES512  | [2], [2, 3]  // 2: EC2 ; 2: EC2, 3: P-521   |
    |  (-37)  // PS256  | [3], [3]     // 3: RSA ; 3: RSA             |
    |  (-38)  // PS384  | [3], [3]     // 3: RSA ; 3: RSA             |
    |  (-39)  // PS512  | [3], [3]     // 3: RSA ; 3: RSA             |
    +-------------------+---------------------------------------------+

            Figure 4: Examples Echo Option value included therein, together
   with the pair (gid,kid), where 'gid' is the Group Identifier of Counter Signature Parameters

   The table below provides examples the
   OSCORE group and 'kid' is the Sender ID of values for Secret Derivation
   Parameters the client in the Common group,
   as specified in the 'kid context' and 'kid' fields of the OSCORE
   Option of the request, respectively.  After a group rekeying has been
   completed and a new Security Context has been established in the
   group, which results also in a new Group Identifier (see
   Section 2.1.5), for different 3.2), the server MUST delete all the stored Echo values
   associated to members of Secret Derivation Algorithm.

  +-----------------------+--------------------------------------------+
  | Secret Derivation     | Example Values for Secret                  |
  | that group.

   Upon receiving a 4.01 (Unauthorized) response that includes an Echo
   Option and originates from a verified group member, the client sends
   a request as a unicast message addressed to the same server, echoing
   the Echo Option value.  The client MUST NOT send the request
   including the Echo Option over multicast.

   If the group uses also the group mode and the used Signature
   Algorithm             | Derivation Parameters                      |
  +-----------------------+--------------------------------------------+
  |  (-27)  // ECDH-SS    | [1], [1, 4]  // 1: OKP ; 1: OKP, 4: X25519 |
  |         // + HKDF-256 |                                            |
  |  (-27)  // ECDH-SS    | [1], [1, 5]  // 1: OKP ; 1: OKP, 5: X448   |
  |         // + HKDF-256 |                                            |
  |  (-27)  // ECDH-SS    | [2], [2, 1]  // 2: EC2 ; 2: EC2, 1: P-256  |
  |         // + HKDF-256 |                                            |
  |  (-27)  // ECDH-SS    | [2], [2, 2]  // 2: EC2 ; 2: EC2, 2: P-384  |
  |         // + HKDF-256 |                                            |
  |  (-27)  // ECDH-SS    | [2], [2, 3]  // 2: EC2 ; 2: EC2, 3: P-512  |
  |         // + HKDF-256 |                                            |
  +-----------------------+--------------------------------------------+

            Figure 5: Examples of Secret Derivation Parameters

Appendix H.  Parameter Extensibility for Future COSE Algorithms

   As supports ECDH (e.g., ECDSA, EdDSA), the client MUST use the
   pairwise mode of Group OSCORE to protect the request, as described in
   Section 9.3.  Note that, as defined in Section 8.1 9, members of [I-D.ietf-cose-rfc8152bis-algs], future
   algorithms such a
   group and that use the Echo Option MUST support the pairwise mode.

   The client does not necessarily resend the same group request, but
   can be registered instead send a more recent one, if the application permits it.
   This makes it possible for the client to not retain previously sent
   group requests for full retransmission, unless the application
   explicitly requires otherwise.  In either case, the client uses a
   fresh Sender Sequence Number value from its own Sender Context.  If
   the client stores group requests for possible retransmission with the
   Echo Option, it should not store a given request for longer than a
   preconfigured time interval.  Note that the unicast request echoing
   the Echo Option is correctly treated and processed as a message,
   since the 'kid context' field including the Group Identifier of the
   OSCORE group is still present in the "COSE Algorithms" Registry
   [COSE.Algorithms] OSCORE Option as specifying none or multiple part of the
   COSE capabilities.

   To enable object (see Section 4).

   Upon receiving the seamless use of such future registered algorithms, this
   section defines a general, agile format unicast request including the Echo Option, the
   server performs the following verifications.

   *  If the server does not store an Echo Option value for parameters of the pair
      (gid,kid), it considers: i) the time t1 when it has established
      the Security Context used to protect the received request; and ii)
      the time t2 when the request has been received.  Since a valid
      request cannot be older than the Security Context (see Section 2.1.3 and Section 2.1.5) and for
   related elements used to protect
      it, the server verifies that (t2 - t1) is less than the largest
      amount of time acceptable to consider the external_aad structure (see Section 4.3). request fresh.

   *  If any of the currently registered COSE algorithms is considered,
   using this general format yields server stores an Echo Option value for the pair (gid,kid)
      associated to that same structure defined client in this
   document for the items above, thus ensuring retro-compatibility.

H.1.  Counter Signature Parameters

   The definition of Counter Signature Parameters in same group, the Common Context
   (see Section 2.1.3) is generalized as follows.

   Counter Signature Parameters is server
      verifies that the option value equals that same stored value
      previously sent to that client.

   If the verifications above fail, the server MUST NOT process the
   request further and MAY send a CBOR array CS_PARAMS 4.01 (Unauthorized) response including N+1
   elements, whose exact structure
   an Echo Option.

   If the verifications above are successful and value depend on the value of
   Counter Signature Algorithm.

   o  The first element, i.e. CS_PARAMS[0], is Replay Window has
   not been set yet, the server updates its Replay Window to mark the
   current Sender Sequence Number from the latest received request as
   seen (but all newer ones as new), and delivers the message as fresh
   to the application.  Otherwise, it discards the verification result
   and treats the message as fresh or as a replay, according to the
   existing Replay Window.

   A server should not deliver requests from a given client to the
   application until one valid request from that same client has been
   verified as fresh, as conveying an echoed Echo Option
   [I-D.ietf-core-echo-request-tag].  Also, a server may perform the array
   challenge-response described above at any time, if synchronization
   with Sender Sequence Numbers of the N COSE
      capabilities for Counter Signature Algorithm, as specified clients is lost, for
      that algorithm in instance after a
   device reboot.  A client has to be always ready to perform the "Capabilities" column of
   challenge-response based on the "COSE
      Algorithms" Registry [COSE.Algorithms] (see Section 8.1 of
      [I-D.ietf-cose-rfc8152bis-algs]).

   o  Each following element CS_PARAMS[i], i.e. with index i > 0, Echo Option in case a server starts
   it.

   It is the
      array role of COSE capabilities for the algorithm capability specified
      in CS_PARAMS[0][i-1].

      For example, if CS_PARAMS[0][0] specifies server application to define under what
   circumstances Sender Sequence Numbers lose synchronization.  This can
   include experiencing a "large enough" gap D = (SN2 - SN1), between
   the key type as
      capability Sender Sequence Number SN1 of the algorithm, then CS_PARAMS[1] is latest accepted group request
   from a client and the array Sender Sequence Number SN2 of
      COSE capabilities for the COSE key type associated a group request
   just received from that client.  However, a client may send several
   unicast requests to Counter
      Signature Algorithm, different group members as specified for that key type in the
      "Capabilities" column of protected with the "COSE Key Types" Registry
      [COSE.Key.Types]
   pairwise mode (see Section 8.2 of
      [I-D.ietf-cose-rfc8152bis-algs]).

H.2.  Secret Derivation Parameters

   The definition of Secret Derivation Parameters 9.3), which may result in the Common Context
   (see Section 2.1.5) is generalized as follows.

   Secret Derivation Parameters server
   experiencing the gap D in a relatively short time.  This would induce
   the server to perform more challenge-response exchanges than actually
   needed.

   To ameliorate this, the server may rather rely on a trade-off between
   the Sender Sequence Number gap D and a time gap T = (t2 - t1), where
   t1 is the time when the latest group request from a CBOR array SD_PARAMS including N+1
   elements, whose exact structure client was
   accepted and value depend on the value of
   Secret Derivation Algorithm.

   o  The first element, i.e. SD_PARAMS[0], t2 is the array of time when the N COSE
      capabilities for Secret Derivation Algorithm, as specified for latest group request from that algorithm in
   client has been received, respectively.  Then, the "Capabilities" column of server can start a
   challenge-response when experiencing a time gap T larger than a
   given, preconfigured threshold.  Also, the "COSE
      Algorithms" Registry [COSE.Algorithms] (see Section 8.1 server can start a
   challenge-response when experiencing a Sender Sequence Number gap D
   greater than a different threshold, computed as a monotonically
   increasing function of
      [I-D.ietf-cose-rfc8152bis-algs]).

   o  Each following element SD_PARAMS[i], i.e. with index i > 0, is the
      array currently experienced time gap T.

   The challenge-response approach described in this appendix provides
   an assurance of COSE capabilities for the algorithm capability specified absolute message freshness.  However, it can result
   in SD_PARAMS[0][i-1].

      For example, if SD_PARAMS[0][0] specifies an impact on performance which is undesirable or unbearable,
   especially in large groups where many endpoints at the key type same time
   might join as
      capability of new members or lose synchronization.

   Note that endpoints configured as silent servers are not able to
   perform the algorithm, then SD_PARAMS[1] is challenge-response described above, as they do not store
   a Sender Context to secure the array of
      COSE capabilities for 4.01 (Unauthorized) response to the COSE key type associated
   client.  Therefore, silent servers should adopt alternative
   approaches to Secret
      Derivation Algorithm, as specified for that key type in achieve and maintain synchronization with Sender
   Sequence Numbers of clients.

   Since requests including the
      "Capabilities" column Echo Option are sent over unicast, a
   server can be a victim of the "COSE Key Types" Registry
      [COSE.Key.Types] (see attack discussed in Section 8.2 10.9, when
   such requests are protected with the group mode of
      [I-D.ietf-cose-rfc8152bis-algs]).

H.3.  'par_countersign' Group OSCORE, as
   described in Section 8.1.

   Instead, protecting requests with the external_aad

   The definition Echo Option by using the
   pairwise mode of Group OSCORE as described in Section 9.3 prevents
   the 'par_countersign' element attack in Section 10.9.  In fact, only the 'algorithms'
   array of exact server involved
   in the external_aad structure (see Section 4.3) Echo exchange is generalized
   as follows.

   The 'par_countersign' element takes able to derive the CBOR array CS_PARAMS
   specified correct pairwise key used
   by Counter Signature Parameters in the Common Context (see
   Section 2.1.3), considering client to protect the format generalization in Appendix H. request including the Echo Option.

   In particular:

   o  The first element 'countersign_alg_capab' is either case, an internal on-path adversary would not be able to
   mix up the array Echo Option value of COSE
      capabilities for two different unicast requests, sent
   by a same client to any two different servers in the group.  In fact,
   if the group mode was used, this would require the adversary to forge
   the client's countersignature algorithm indicated in
      'alg_countersign'.  This is CS_PARAMS[0], i.e. the first element both such requests.  As a
   consequence, each of the CBOR array CS_PARAMS specified by Counter Signature
      Parameters in two servers remains able to selectively
   accept a request with the Common Context.

   o  Each following element 'countersign_capab_i' (i = 1, ..., N) Echo Option only if it is waiting for that
   exact integrity-protected Echo Option value, and is thus the array intended
   recipient.

Appendix F.  Document Updates

   RFC EDITOR: PLEASE REMOVE THIS SECTION.

F.1.  Version -11 to -12

   *  No mode of operation is mandatory to support.

   *  Revised parameters of the Security Context, COSE object and
      external_aad.

   *  Revised management of COSE capabilities keying material for the algorithm capability
      specified in 'countersign_alg_capab'[i-1].  This algorithm
      capability is the element CS_PARAMS[0][i-1] Group Manager.

   *  Informing of former members when rekeying the CBOR array
      CS_PARAMS specified by Counter Signature Parameters group.

   *  Admit encryption-only algorithms in the Common
      Context.

      For example, if 'countersign_alg_capab'[i-1] specifies the group mode.

   *  Encrypted countersignature through a keystream.

   *  Added public key
      type as capability of the algorithm, then 'countersign_capab_i' is
      the array of COSE capabilities for the COSE key type associated to
      Counter Signature Algorithm, Group Manager as specified for that key type in the
      "Capabilities" column material and
      protected data.

   *  Clarifications about message processing, especially notifications.

   *  Guidance for message processing of the "COSE Key Types" Registry
      [COSE.Key.Types] (see Section 8.2 external signature checkers.

   *  Updated derivation of
      [I-D.ietf-cose-rfc8152bis-algs]).

      external_aad = bstr .cbor aad_array

      aad_array = [
         oscore_version : uint,
         algorithms : [alg_aead : int / tstr,
                       alg_countersign : int / tstr,
                       par_countersign : [countersign_alg_capab,
                                          countersign_capab_1,
                                          countersign_capab_2,
                                          ...,
                                          countersign__capab_N]],
         request_kid : bstr,
         request_piv : bstr,
         options : bstr,
         request_kid_context : bstr,
         OSCORE_option: bstr
      ]

      countersign_alg_capab : [c_1 : any, c_2 : any, ..., c_N : any]

           Figure 6: external_aad pairwise keys, with general 'par_countersign'

Appendix I.  Document Updates

   RFC EDITOR: PLEASE REMOVE THIS SECTION.

I.1. more security
      considerations.

   *  Termination of ongoing observations as client, upon leaving or
      before re-joining the group.

   *  Recycling Group IDs by tracking the "Birth Gid" of each group
      member.

   *  Expanded security and privacy considerations about the group mode.

   *  Removed appendices on skipping signature verification and on COSE
      capabilities.

   *  Fixes and editorial improvements.

F.2.  Version -10 to -11

   o

   *  Loss of Recipient Contexts due to their overflow.

   o

   *  Added diagram on keying material components and their relation.

   o

   *  Distinction between anti-replay and freshness.

   o

   *  Preservation of Sender IDs over rekeying.

   o

   *  Clearer cause-effect about reset of SSN.

   o

   *  The GM provides public keys of group members with associated
      Sender IDs.

   o

   *  Removed 'par_countersign_key' from the external_aad.

   o

   *  One single format for the external_aad, both for encryption and
      signing.

   o

   *  Presence of 'kid' in responses to requests protected with the
      pairwise mode.

   o

   *  Inclusion of 'kid_context' in notifications following a group
      rekeying.

   o

   *  Pairwise mode presented with OSCORE as baseline.

   o

   *  Revised examples with signature values.

   o

   *  Decoupled growth of clients' Sender Sequence Numbers and loss of
      synchronization for server.

   o

   *  Sender IDs not recycled in the group under the same Gid.

   o

   *  Processing and description of the Group Flag bit in the OSCORE
      option.

   o

   *  Usage of the pairwise mode for multicast requests.

   o

   *  Clarifications on synchronization using the Echo option.

   o

   *  General format of context parameters and external_aad elements,
      supporting future registered COSE algorithms (new Appendix).

   o

   *  Fixes and editorial improvements.

I.2.

F.3.  Version -09 to -10

   o

   *  Removed 'Counter Signature Key Parameters' from the Common
      Context.

   o

   *  New parameters in the Common Context covering the DH secret
      derivation.

   o

   *  New counter signature countersignature header parameter from draft-ietf-cose-
      countersign.

   o

   *  Stronger policies non non-recycling of Sender IDs and Gid.

   o

   *  The Sender Sequence Number is reset when establishing a new
      Security Context.

   o

   *  Added 'request_kid_context' in the aad_array.

   o

   *  The server can respond with 5.03 if the client's public key is not
      available.

   o

   *  The observer client stores an invariant identifier of the group.

   o

   *  Relaxed storing of original 'kid' for observer clients.

   o

   *  Both client and server store the 'kid_context' of the original
      observation request.

   o

   *  The server uses a fresh PIV if protecting the response with a
      Security Context different from the one used to protect the
      request.

   o

   *  Clarifications on MTI algorithms and curves.

   o

   *  Removed optimized requests.

   o

   *  Overall clarifications and editorial revision.

I.3.

F.4.  Version -08 to -09

   o

   *  Pairwise keys are discarded after group rekeying.

   o

   *  Signature mode renamed to group mode.

   o

   *  The parameters for countersignatures use the updated COSE
      registries.  Newly defined IANA registries have been removed.

   o

   *  Pairwise Flag bit renamed as Group Flag bit, set to 1 in group
      mode and set to 0 in pairwise mode.

   o

   *  Dedicated section on updating the Security Context.

   o

   *  By default, sender sequence numbers and replay windows are not
      reset upon group rekeying.

   o

   *  An endpoint implementing only a silent server does not support the
      pairwise mode.

   o

   *  Separate section on general message reception.

   o

   *  Pairwise mode moved to the document body.

   o

   *  Considerations on using the pairwise mode in non-multicast
      settings.

   o

   *  Optimized requests are moved as an appendix.

   o

   *  Normative support for the signature and pairwise mode.

   o

   *  Revised methods for synchronization with clients' sender sequence
      number.

   o

   *  Appendix with example values of parameters for countersignatures.

   o

   *  Clarifications and editorial improvements.

I.4.

F.5.  Version -07 to -08

   o

   *  Clarified relation between pairwise mode and group communication
      (Section 1).

   o

   *  Improved definition of "silent server" (Section 1.1).

   o

   *  Clarified when a Recipient Context is needed (Section 2).

   o

   *  Signature checkers as entities supported by the Group Manager
      (Section 2.3).

   o

   *  Clarified that the Group Manager is under exclusive control of Gid
      and Sender ID values in a group, with Sender ID values under each
      Gid value (Section 2.3).

   o

   *  Mitigation policies in case of recycled 'kid' values
      (Section 2.4).

   o

   *  More generic exhaustion (not necessarily wrap-around) of sender
      sequence numbers (Sections 2.5 and 10.11).

   o

   *  Pairwise key considerations, as to group rekeying and Sender
      Sequence Numbers (Section 3).

   o

   *  Added reference to static-static Diffie-Hellman shared secret
      (Section 3).

   o

   *  Note for implementation about the external_aad for signing
      (Sectino 4.3.2).

   o

   *  Retransmission by the application for group requests over
      multicast as Non-Confirmable (Section 7).

   o

   *  A server MUST use its own Partial IV in a response, if protecting
      it with a different context than the one used for the request
      (Section 7.3).

   o

   *  Security considerations: encryption of pairwise mode as
      alternative to group-level security (Section 10.1).

   o

   *  Security considerations: added approach to reduce the chance of
      global collisions of Gid values from different Group Managers
      (Section 10.5).

   o

   *  Security considerations: added implications for block-wise
      transfers when using the signature mode for requests over unicast
      (Section 10.7).

   o

   *  Security considerations: (multiple) supported signature algorithms
      (Section 10.13).

   o

   *  Security considerations: added privacy considerations on the
      approach for reducing global collisions of Gid values
      (Section 10.15).

   o

   *  Updates to the methods for synchronizing with clients' sequence
      number (Appendix E).

   o

   *  Simplified text on discovery services supporting the pairwise mode
      (Appendix G.1).

   o

   *  Editorial improvements.

I.5.

F.6.  Version -06 to -07

   o

   *  Updated abstract and introduction.

   o

   *  Clarifications of what pertains a group rekeying.

   o

   *  Derivation of pairwise keying material.

   o

   *  Content re-organization for COSE Object and OSCORE header
      compression.

   o

   *  Defined the Pairwise Flag bit for the OSCORE option.

   o

   *  Supporting CoAP Observe for group requests and responses.

   o

   *  Considerations on message protection across switching to new
      keying material.

   o

   *  New optimized mode based on pairwise keying material.

   o

   *  More considerations on replay protection and Security Contexts
      upon key renewal.

   o

   *  Security considerations on Group OSCORE for unicast requests, also
      as affecting the usage of the Echo option.

   o

   *  Clarification on different types of groups considered
      (application/security/CoAP).

   o

   *  New pairwise mode, using pairwise keying material for both
      requests and responses.

I.6.

F.7.  Version -05 to -06

   o

   *  Group IDs mandated to be unique under the same Group Manager.

   o

   *  Clarifications on parameter update upon group rekeying.

   o

   *  Updated external_aad structures.

   o

   *  Dynamic derivation of Recipient Contexts made optional and
      application specific.

   o

   *  Optional 4.00 response for failed signature verification on the
      server.

   o

   *  Removed client handling of duplicated responses to multicast
      requests.

   o

   *  Additional considerations on public key retrieval and group
      rekeying.

   o

   *  Added Group Manager responsibility on validating public keys.

   o

   *  Updates IANA registries.

   o

   *  Reference to RFC 8613.

   o

   *  Editorial improvements.

I.7.

F.8.  Version -04 to -05

   o

   *  Added references to draft-dijk-core-groupcomm-bis.

   o

   *  New parameter Counter Signature Key Parameters (Section 2).

   o

   *  Clarification about Recipient Contexts (Section 2).

   o

   *  Two different external_aad for encrypting and signing
      (Section 3.1).

   o

   *  Updated response verification to handle Observe notifications
      (Section 6.4).

   o

   *  Extended Security Considerations (Section 8).

   o

   *  New "Counter Signature Key Parameters" IANA Registry
      (Section 9.2).

I.8.

F.9.  Version -03 to -04

   o

   *  Added the new "Counter Signature Parameters" in the Common Context
      (see Section 2).

   o

   *  Added recommendation on using "deterministic ECDSA" if ECDSA is
      used as counter signature countersignature algorithm (see Section 2).

   o

   *  Clarified possible asynchronous retrieval of keying material from
      the Group Manager, in order to process incoming messages (see
      Section 2).

   o

   *  Structured Section 3 into subsections.

   o

   *  Added the new 'par_countersign' to the aad_array of the
      external_aad (see Section 3.1).

   o

   *  Clarified non reliability of 'kid' as identity indicator for a
      group member (see Section 2.1).

   o

   *  Described possible provisioning of new Sender ID in case of
      Partial IV wrap-around (see Section 2.2).

   o

   *  The former signature bit in the Flag Byte of the OSCORE option
      value is reverted to reserved (see Section 4.1).

   o

   *  Updated examples of compressed COSE object, now with the sixth
      less significant bit in the Flag Byte of the OSCORE option value
      set to 0 (see Section 4.3).

   o

   *  Relaxed statements on sending error messages (see Section 6).

   o

   *  Added explicit step on computing the counter signature countersignature for outgoing
      messages (see Sections 6.1 and 6.3).

   o

   *  Handling of just created Recipient Contexts in case of
      unsuccessful message verification (see Sections 6.2 and 6.4).

   o

   *  Handling of replied/repeated responses on the client (see
      Section 6.4).

   o

   *  New IANA Registry "Counter Signature Parameters" (see
      Section 9.1).

I.9.

F.10.  Version -02 to -03

   o

   *  Revised structure and phrasing for improved readability and better
      alignment with draft-ietf-core-object-security.

   o

   *  Added discussion on wrap-Around of Partial IVs (see Section 2.2).

   o

   *  Separate sections for the COSE Object (Section 3) and the OSCORE
      Header Compression (Section 4).

   o

   *  The countersignature is now appended to the encrypted payload of
      the OSCORE message, rather than included in the OSCORE Option (see
      Section 4).

   o

   *  Extended scope of Section 5, now titled " Message Binding,
      Sequence Numbers, Freshness and Replay Protection".

   o

   *  Clarifications about Non-Confirmable messages in Section 5.1
      "Synchronization of Sender Sequence Numbers".

   o

   *  Clarifications about error handling in Section 6 "Message
      Processing".

   o

   *  Compacted list of responsibilities of the Group Manager in
      Section 7.

   o

   *  Revised and extended security considerations in Section 8.

   o

   *  Added IANA considerations for the OSCORE Flag Bits Registry in
      Section 9.

   o

   *  Revised Appendix D, now giving a short high-level description of a
      new endpoint set-up.

I.10.

F.11.  Version -01 to -02

   o

   *  Terminology has been made more aligned with RFC7252 and draft-
      ietf-core-object-security: i) "client" and "server" replace the
      old "multicaster" and "listener", respectively; ii) "silent
      server" replaces the old "pure listener".

   o

   *  Section 2 has been updated to have the Group Identifier stored in
      the 'ID Context' parameter defined in draft-ietf-core-object-
      security.

   o

   *  Section 3 has been updated with the new format of the Additional
      Authenticated Data.

   o

   *  Major rewriting of Section 4 to better highlight the differences
      with the message processing in draft-ietf-core-object-security.

   o

   *  Added Sections 7.2 and 7.3 discussing security considerations
      about uniqueness of (key, nonce) and collision of group
      identifiers, respectively.

   o

   *  Minor updates to Appendix A.1 about assumptions on multicast
      communication topology and group size.

   o

   *  Updated Appendix C on format of group identifiers, with practical
      implications of possible collisions of group identifiers.

   o

   *  Updated Appendix D.2, adding a pointer to draft-palombini-ace-key-
      groupcomm about retrieval of nodes' public keys through the Group
      Manager.

   o

   *  Minor updates to Appendix E.3 about Challenge-Response
      synchronization of sequence numbers based on the Echo option from
      draft-ietf-core-echo-request-tag.

I.11.

F.12.  Version -00 to -01

   o

   *  Section 1.1 has been updated with the definition of group as
      "security group".

   o

   *  Section 2 has been updated with:

      *

      -  Clarifications on establishment/derivation of Security
         Contexts.

      *

      -  A table summarizing the the additional context elements
         compared to OSCORE.

   o

   *  Section 3 has been updated with:

      *

      -  Examples of request and response messages.

      *

      -  Use of CounterSignature0 rather than CounterSignature.

      *

      -  Additional Authenticated Data including also the signature
         algorithm, while not including the Group Identifier any longer.

   o

   *  Added Section 6, listing the responsibilities of the Group
      Manager.

   o

   *  Added Appendix A (former section), including assumptions and
      security objectives.

   o

   *  Appendix B has been updated with more details on the use cases.

   o

   *  Added Appendix C, providing an example of Group Identifier format.

   o

   *  Appendix D has been updated to be aligned with draft-palombini-
      ace-key-groupcomm.

Acknowledgments

   The authors sincerely thank Christian Amsuess, Stefan Beck, Rolf
   Blom, Carsten Bormann, Esko Dijk, Martin Gunnarsson, Klaus Hartke,
   Rikard Hoeglund, Richard Kelsey, Dave Robin, Jim Schaad, Ludwig
   Seitz, Peter van der Stok and Erik Thormarker for their feedback and
   comments.

   The work on this document has been partly supported by VINNOVA and
   the Celtic-Next project CRITISEC; the H2020 project SIFIS-Home (Grant
   agreement 952652); the SSF project SEC4Factory under the grant
   RIT17-0032; and the EIT-Digital High Impact Initiative ACTIVE.

Authors' Addresses

   Marco Tiloca
   RISE AB
   Isafjordsgatan 22
   Kista
   SE-16440 Stockholm Kista
   Sweden

   Email: marco.tiloca@ri.se

   Goeran

   Göran Selander
   Ericsson AB
   Torshamnsgatan 23
   Kista
   SE-16440 Stockholm Kista
   Sweden

   Email: goran.selander@ericsson.com

   Francesca Palombini
   Ericsson AB
   Torshamnsgatan 23
   Kista
   SE-16440 Stockholm Kista
   Sweden

   Email: francesca.palombini@ericsson.com
   John Preuss Mattsson
   Ericsson AB
   Torshamnsgatan 23
   Kista
   SE-16440 Stockholm Kista
   Sweden

   Email: john.mattsson@ericsson.com

   Jiye Park
   Universitaet Duisburg-Essen
   Schuetzenbahn 70
   Essen
   45127 Essen
   Germany

   Email: ji-ye.park@uni-due.de