1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/logging.h"
6 #include "net/der/tag.h"
12 Tag
ContextSpecificConstructed(uint8_t class_number
) {
13 DCHECK_EQ(class_number
, class_number
& kTagNumberMask
);
14 return (class_number
& kTagNumberMask
) | kTagConstructed
|
18 Tag
ContextSpecificPrimitive(uint8_t base
) {
19 DCHECK_EQ(base
, base
& kTagNumberMask
);
20 return (base
& kTagNumberMask
) | kTagPrimitive
| kTagContextSpecific
;
23 bool IsConstructed(Tag tag
) {
24 return (tag
& kTagConstructionMask
) == kTagConstructed
;