You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/key.cpp
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
// Copyright (c) 2009-2014 The Bitcoin developers
2
-
// Distributed under the MIT/X11 software license, see the accompanying
2
+
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
5
#include"key.h"
@@ -13,7 +13,7 @@
13
13
#include"ecwrapper.h"
14
14
#endif
15
15
16
-
// anonymous namespace
16
+
//! anonymous namespace with local implementation code (OpenSSL interaction)
Copy file name to clipboardExpand all lines: src/key.h
+78-61Lines changed: 78 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
-
// Copyright (c) 2009-2013 The Bitcoin developers
3
-
// Distributed under the MIT/X11 software license, see the accompanying
2
+
// Copyright (c) 2009-2014 The Bitcoin developers
3
+
// Distributed under the MIT software license, see the accompanying
4
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
6
6
#ifndef BITCOIN_KEY_H
@@ -14,13 +14,15 @@
14
14
#include<stdexcept>
15
15
#include<vector>
16
16
17
-
// secp256k1:
18
-
// const unsigned int PRIVATE_KEY_SIZE = 279;
19
-
// const unsigned int PUBLIC_KEY_SIZE = 65;
20
-
// const unsigned int SIGNATURE_SIZE = 72;
21
-
//
22
-
// see www.keylength.com
23
-
// script supports up to 75 for single byte push
17
+
/**
18
+
* secp256k1:
19
+
* const unsigned int PRIVATE_KEY_SIZE = 279;
20
+
* const unsigned int PUBLIC_KEY_SIZE = 65;
21
+
* const unsigned int SIGNATURE_SIZE = 72;
22
+
*
23
+
* see www.keylength.com
24
+
* script supports up to 75 for single byte push
25
+
*/
24
26
25
27
/** A reference to a CKey: the Hash160 of its serialized public key */
26
28
classCKeyID : publicuint160
@@ -34,11 +36,14 @@ class CKeyID : public uint160
34
36
classCPubKey
35
37
{
36
38
private:
37
-
// Just store the serialized data.
38
-
// Its length can very cheaply be computed from the first byte.
39
+
40
+
/**
41
+
* Just store the serialized data.
42
+
* Its length can very cheaply be computed from the first byte.
43
+
*/
39
44
unsignedchar vch[65];
40
45
41
-
// Compute the length of a pubkey with a given first byte.
46
+
//! Compute the length of a pubkey with a given first byte.
42
47
unsignedintstaticGetLen(unsignedchar chHeader)
43
48
{
44
49
if (chHeader == 2 || chHeader == 3)
@@ -48,20 +53,20 @@ class CPubKey
48
53
return0;
49
54
}
50
55
51
-
// Set this key data to be invalid
56
+
//! Set this key data to be invalid
52
57
voidInvalidate()
53
58
{
54
59
vch[0] = 0xFF;
55
60
}
56
61
57
62
public:
58
-
// Construct an invalid public key.
63
+
//! Construct an invalid public key.
59
64
CPubKey()
60
65
{
61
66
Invalidate();
62
67
}
63
68
64
-
// Initialize a public key using begin/end iterators to byte data.
69
+
//! Initialize a public key using begin/end iterators to byte data.
65
70
template <typename T>
66
71
voidSet(const T pbegin, const T pend)
67
72
{
@@ -72,26 +77,26 @@ class CPubKey
72
77
Invalidate();
73
78
}
74
79
75
-
// Construct a public key using begin/end iterators to byte data.
80
+
//! Construct a public key using begin/end iterators to byte data.
76
81
template <typename T>
77
82
CPubKey(const T pbegin, const T pend)
78
83
{
79
84
Set(pbegin, pend);
80
85
}
81
86
82
-
// Construct a public key from a byte vector.
87
+
//! Construct a public key from a byte vector.
83
88
CPubKey(const std::vector<unsignedchar>& vch)
84
89
{
85
90
Set(vch.begin(), vch.end());
86
91
}
87
92
88
-
// Simple read-only vector-like interface to the pubkey data.
93
+
//! Simple read-only vector-like interface to the pubkey data.
0 commit comments